When I have a required field which has type of a union which is itself defined as a type, the field is just a ref to that type, when I make the field optional with ?, I get an anyOf, not a $ref.
If this is intentional and therefore won't be changed, is there a way to change behaviour to be consistent?
Example - field required
type FooBar = number | string
export interface Demo {
thing: FooBar
}
Great library, thanks so much.
When I have a required field which has type of a union which is itself defined as a type, the field is just a ref to that type, when I make the field optional with
?
, I get ananyOf
, not a$ref
.If this is intentional and therefore won't be changed, is there a way to change behaviour to be consistent?
Example - field required
Schema:
Example - field not required
Schema: