API: publish forecast as arrays with unix timestamps (BC) (#32391)

This commit is contained in:
andig 2026-08-06 11:49:33 +02:00 • committed by GitHub
parent 9d0bc5a865
commit 45e781dac0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
35 changed files with 361 additions and 223 deletions

View file

@ -113,6 +113,13 @@ function normalizeNullables(schema: AnySchema): void {
node.allOf = rest;
}
}
// openapi 3.0 cannot express tuple positions, document tuples as
// fixed-length uniform arrays; positional meaning lives in the description
if (Array.isArray(node.items)) {
const types = [...new Set(node.items.map((item: AnySchema) => item.type))];
if (types.length !== 1) throw new Error(`tuple with mixed item types not supported`);
node.items = { type: types[0] };
}
// openapi 3.0 has no `const`, use a single-value enum
if ("const" in node) {
node.enum = [node.const];