Open
Description
If a property narrows an enum with allOf (a $ref to the enum plus a shorter enum list), the generator drops the model, along with every model that references it.
components:
schemas:
CloudProvider:
type: string
enum: [AWS, AZURE]
Region:
type: object
required: [provider]
properties:
provider:
allOf:
- $ref: '#/components/schemas/CloudProvider'
- enum: [AWS]On 0.29.1 this gives Cannot take allOf a non-object and Region is dropped. In our spec, a handful of these ended up dropping models used by 20 endpoints.
I'd expect provider to come out as CloudProvider, ideally limited to AWS. merge_properties already merges two enums like this when they come from an object-level allOf. It just never gets called when the allOf sits on the property itself, because that case goes straight to ModelProperty.build.
I opened a possible fix in #1499. Same caveat as there: an AI agent wrote it and it has no tests yet.
Metadata
Metadata
Assignees
Labels
No labels
Activity