Skip to content
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

support "stringy booleans", for some types of data only #83

Open
karenetheridge opened this issue Dec 9, 2023 · 1 comment
Open

support "stringy booleans", for some types of data only #83

karenetheridge opened this issue Dec 9, 2023 · 1 comment

Comments

@karenetheridge
Copy link
Owner

karenetheridge commented Dec 9, 2023

For some payloads, e.g. query parameters that are exploded into an object from a string, a value might convey a boolean value but was represented as a string. Provide an option to allow strings that match true or false to be validated as a boolean value:

When this configuration is enabled (default false),

data "false" and "true" will validate successfully against

  • "type": "boolean"
  • "type": ["boolean", ..]
  • "const": true or "const": false
  • "enum": [true, false]
@karenetheridge
Copy link
Owner Author

meh? YAGNI? why can't we just say "enum":["true","false"] instead, because the range of values for booleans is so limited?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant