-
Notifications
You must be signed in to change notification settings - Fork 9.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: nullable & optional/required marks #1775
Comments
Non-nullable and optional is the default in a schema object for properties. |
If non-nullable and optional is default, how to represent nullable and required? |
From https://swagger.io/docs/specification/data-models/data-types/
what I am searching/needed
|
As I understand, it will be like
Am I correct? |
@tedepstein is there more to say here given the |
@handrews, yes, I think it can be closed. @raderio, I think the proposed clarification of A few things in particular:
|
We agreed to close this and apparently I forgot to actually close it 🤦 |
Can we represent in specification that a field is non-nullable & optional?
this mean, or we send a data for the field, or just do not send the field in request,
null
is not allowed.{"foo": "bar", "baz": true}
is allowed{"baz": true}
is allowed, because is optional{"foo": null, "baz": true}
is NOT allowed, because is non-nullableBasically
null
has the meaning of "this property existed before, and I want to nullify its value". If there's no value, or the value needs not change (for requests, for example), it just shouldn't be sent.The text was updated successfully, but these errors were encountered: