-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Currently we take a pretty strict interpretation of allOf which means that constructs like the below don't work as a user might expect:
components:
schemas:
PartialObject:
type: object
properties:
foo:
type: string
bar:
type: number
RequiredObject:
allOf:
- $ref: '#/components/schemas/PartialObject'
- required:
- foo
- barCurrently this ends up as {foo?: string, bar?: number} & {[key: string]: never} which isn't very useful, though fairly faithful to the specification ({foo?: string, bar?: number} & {foo: unknown, bar: unknown} might arguably be more accurate)
Other tooling such as swagger editor instead merges/flattens the schemas together, eg:
We should investigate whether its possible to relax the rules a bit here, without compromising the ability to create types like Dog & Cat
Metadata
Metadata
Assignees
Labels
No labels
