You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Multi-type unions aren't handled for OpenAPI 3.1 #2521
error generating code: error collecting component types: error generating Go types for component schemas: error converting Schema Event to Go type: error generating type for additional properties: error resolving primitive type: unhandled Schema type: &[string number boolean]
The position doesn't matter. additionalProperties is just where it happens to land here. A union in a property, parameter, body, or array items fails the same way, because the primitive-type dispatch in pkg/codegen/schema.go uses Types.Is(...), which only matches a single-element type list.
Expected: type Event map[string]any. Go has no type meaning "one of these", so any is the same permissive mapping a bare type: "null" got in #2430.
This comes up in real specs. Honeycomb's published 3.1 spec has two of these for genuinely polymorphic event and query-result values, and the only workaround today is an overlay that deletes the type keyword before generation.
oapi-codegen version: current main (6768b63)
Go version: 1.26.5
For the parameter-position gap found in the review of #2522 (a union param binds into an any destination, which the runtime rejects on every request), we've filed oapi-codegen/runtime#153 with the minimal runtime change: a Types []string field on the bind options, consulted only for interface destinations, walked in specificity order with JSON-grammar numeric detection. The codegen side (emitting Types, fixing SchemaType()'s first-entry behavior) will be tracked here once the runtime shape settles.
Activity
mromaszewicz commentedon Aug 16, 2026
For the parameter-position gap found in the review of #2522 (a union param binds into an
anydestination, which the runtime rejects on every request), we've filed oapi-codegen/runtime#153 with the minimal runtime change: aTypes []stringfield on the bind options, consulted only for interface destinations, walked in specificity order with JSON-grammar numeric detection. The codegen side (emittingTypes, fixingSchemaType()'s first-entry behavior) will be tracked here once the runtime shape settles.