Skip to content

Adds tests for non zero-padded dates #426

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

Merged
merged 4 commits into from
Aug 14, 2020

Conversation

helrond
Copy link
Contributor

@helrond helrond commented Aug 13, 2020

As outlined in IETF RFC 3559, section 5.6, dates should follow the format YYYY-MM-DD, so days or months that are non-zero padded should be invalid.

The date format was introduced in Draft7 of JSON Schema, so I've only added the tests for that version and 2019-09.

@Julian
Copy link
Member

Julian commented Aug 13, 2020

Thanks again, this is great. One thing we probably should do at the same time is have a look at the date-time tests -- probably these same two tests should be added there as part of the full date-time validation (that YYYY-M-D doesn't pass there either, assuming that's correct behavior there)

Copy link
Member

@karenetheridge karenetheridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you missed draft3, draft4, and draft6 :)

@helrond
Copy link
Contributor Author

helrond commented Aug 13, 2020

@karenetheridge the date format was not introduced until draft7, which Is why draft3, draft4 and draft6 have not been changed.

@karenetheridge
Copy link
Member

ah, I see, date was present in draft3 but left out of 4 and 6.

date-time is present in all drafts from 3 to the present.

@Julian
Copy link
Member

Julian commented Aug 14, 2020

Fantastic. Think this looks good! Merging.

@Julian Julian merged commit fce9e9b into json-schema-org:master Aug 14, 2020
@helrond helrond deleted the padded-dates branch August 14, 2020 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants