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
default - The default value represents what would be assumed by the consumer of the input as the value of the schema if one is not provided. Unlike JSON Schema, the value MUST conform to the defined type for the Schema Object defined at the same level. For example, if type is string, then default can be "foo" but cannot be 1.
So, my understanding is that:
When the consumer is reading the value will always have a value (required)
But, when the consumer is writing the value can be provided or not so that the generated type should also be optional instead of required
Am I missing something?
Thanks for your great library!
The text was updated successfully, but these errors were encountered:
This is no longer true! Now we give you the option. The default command will only treat required as non-nullable. But if you specify the --default-non-nullable flag as well, then it will treat either required or default as non-nullable. That’s the options.defaultNonNullable && part). Hopefully this clarifies things!
This line assumes that a property is
required
when it has adefault
value.According to the specification:
So, my understanding is that:
required
)Am I missing something?
Thanks for your great library!
The text was updated successfully, but these errors were encountered: