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

pattern should only be applicable to the string type, and no other types #242

Closed
Relequestual opened this issue Nov 26, 2018 · 1 comment · Fixed by #336
Closed

pattern should only be applicable to the string type, and no other types #242

Relequestual opened this issue Nov 26, 2018 · 1 comment · Fixed by #336
Labels
good first issue An issue that is a good candidate for new contributors missing test A request to add a test to the suite that is currently not covered elsewhere.

Comments

@Relequestual
Copy link
Member

There's a Stackoverflow question that asks how you can validate the number of digits in a number using JSON Schema: https://stackoverflow.com/questions/53449740/how-can-i-validate-number-of-digits-in-a-number-using-json-schema-ajv/53449981

I explained, you cannot currently do this. Someone suggested you could use pattern, however it is only applicable to strings and not other types.

We have a test for checking pattern isn't applied to a bool, but no test to check that it isn't applied to a number.

There should be a test for checking that pattern isn't incorrectly applied to all other types. Some languages will stringify numbers.

@Julian Julian added the missing test A request to add a test to the suite that is currently not covered elsewhere. label Sep 27, 2019
@Julian
Copy link
Member

Julian commented Nov 29, 2019

This depends on #244.

@Julian Julian added the good first issue An issue that is a good candidate for new contributors label Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue An issue that is a good candidate for new contributors missing test A request to add a test to the suite that is currently not covered elsewhere.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants