-
-
Notifications
You must be signed in to change notification settings - Fork 582
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
YYYY-M-D is incorrectly allowed as a format for dates #685
Comments
Sounds like a bug if so. An upstream test case would be appreciated in the upstream test suite (and of course a PR even more appreciated). |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I am experiencing this issue too, which I believe is occurring because I've added a PR to the upstream validation library. I'd also be happy to submit a PR here. As I see it there are two options for replacing the current
Any preference? |
Awesome! Thank you very much for filing the upstream PR (I saw you already got a review there but yeah you're on the right track). On implementation... I suppose |
4ecd01f30 Merge pull request #687 from swaeberle/check-single-label-idn-hostnames 732e7275a test single label IDN hostnames ab3924a66 Merge pull request #685 from swaeberle/check-single-label-hostnames 9265a4fa9 do not test hostname with leading digit for older drafts 261b52db1 do not allow starting digits in hostnames for older drafts 9fc231ea4 test digits in hostnames e9b20158e test plain single label hostnames c8b57093d test valid single label hostnames 299aa7fe5 Merge pull request #682 from json-schema-org/useless-branch fbb3cac60 Bump the sanity check to use a released version of jsonschema git-subtree-dir: json git-subtree-split: 4ecd01f30bce36a61224fa0f46c2c3f0cf7481dc
Hi,
I'm struggling with validating "date" type. According to specifications it should be in format
YYYY-MM-DD
(4 digits - 2 digits - 2 digits) but this jsonschema validator is ok withYYYY-M-D
.Example schema snippet:
If I test it in https://www.jsonschemavalidator.net/ it properly throws error:
String '2000-1-01' does not validate against format 'date'.
I don't think that is expected behaviour.
See live demo here: https://repl.it/@TomasPalider/QueasyDrabServerapplication
I came up with workaround by combination date and regex but I don't like it since schema validation should be strict.
The text was updated successfully, but these errors were encountered: