We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, I'm wondering if it's possible to mark a field as optional in the schema?
I was expecting something like:
fields: - name: foo type: string required: false
or
fields: foo?: string
The first is invalid and the second fails validation if foo field isn't found.
foo
Is there some other way to achieve this, or is the scope of validation limited to required fields only?
Many thanks, Will.
The text was updated successfully, but these errors were encountered:
You can use null type for this purpose. For example:
null
fields: - name: foo type: [string, "null"]
fields: - name: foo type: string?
Notes:
[string, "null"]
"null"
Sorry, something went wrong.
That's great, thanks. I had actually tried something like [string, "null"] as a list in yaml but not with the correct syntax.
No branches or pull requests
Hi, I'm wondering if it's possible to mark a field as optional in the schema?
I was expecting something like:
or
The first is invalid and the second fails validation if
foo
field isn't found.Is there some other way to achieve this, or is the scope of validation limited to required fields only?
Many thanks,
Will.
The text was updated successfully, but these errors were encountered: