Repository navigation
v0.11.0
Protobuf oneof support for style-B (wire-compatible) oneOf schemas
OpenAPI schemas that express a wire-compatible union — an object whose oneOf branches each name a single required property, with no discriminator — are now emitted as a native protobuf oneof group instead of being routed to the Go union path.
Event:
type: object
properties:
cat_event: { $ref: '#/components/schemas/Cat' }
dog_event: { $ref: '#/components/schemas/Dog' }
oneOf:
- required: [cat_event]
- required: [dog_event]generates:
message Event {
oneof event {
Cat cat_event = 1 [json_name = "cat_event"];
Dog dog_event = 2 [json_name = "dog_event"];
}
}Highlights
- Variant fields keep their locked field numbers;
FieldNumbersoverrides and removed-variantreservedtombstones continue to work. - oneof members emit in deterministic field-number order (reorder-invariant proto).
- Malformed style-B shapes (branch with zero/multiple required properties, undeclared property, or array variant) are rejected at conversion time with actionable messages.
- The flat/discriminated
oneOfform is unchanged and still routes to the Go union path.
Full changelog: v0.10.0...v0.11.0