-
Notifications
You must be signed in to change notification settings - Fork 25
use nullable on data types #56
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
base: main
Are you sure you want to change the base?
Conversation
Prefer using `nullable: true` over `oneOf: [foo, null]` and `type: [foo, null]`. The `nullable: true` value should only be used if the property is contained in `required` so add the property to that where applicable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's the spec on what nullable
is and where it should be used https://swagger.io/docs/specification/v3_0/data-models/data-types/#null
Just had a couple questions about correctness within the actual output of the API.
$ref: "#/components/schemas/PaintOverride" | ||
nullable: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the value associated with a key in fillOverrideTable
ever null
? Seems like you just wouldn't have the key in the object.
type: string | ||
nullable: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this here but it shouldn't be needed since the field isn't in required
.
Wondering if BaseTypeStyle
does have some required fields that aren't noted in this definition.
type: string | ||
nullable: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as ☝️ in fillOverrideTable
where its not clear if the images
object will ever have a value where object.value == null
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Holding this PR to give it a bit more review -- thank you for your patience so far @donny-dont 🙏🏼
Prefer using
nullable: true
overoneOf: [foo, null]
andtype: [foo, null]
.The
nullable: true
value should only be used if the property is contained inrequired
so add the property to that where applicable.