python-fastjsonschema icon indicating copy to clipboard operation
python-fastjsonschema copied to clipboard

RFC 3339 date month and mday should be two digit

Open billingb opened this issue 2 years ago • 1 comments

draft 07 date format RFC 3339 requires that the date-month and date-mday should be two digits. You can see the appropriate tests in the test suite at https://github.com/json-schema-org/JSON-Schema-Test-Suite/blob/6ce9bc4ce6d22d57fd1d9ebab2caae52bc495319/tests/draft7/optional/format/date.json#L186

Would it be possible to change the fastjsonschema/draft07.py date to:

'date': r'^(?P<year>\d{4})-(?P<month>\d{2})-(?P<day>\d{2})\Z',

which changes the \d{1-2} to \d{2}

Happy to place a PR if you'd like.

billingb avatar Sep 20 '22 20:09 billingb

Thanks for finding this. I will probably need to update the test suite to include new tests like this.

horejsek avatar Sep 26 '22 08:09 horejsek

Fixed in latest development version, will be part of 2.19.1.

horejsek avatar Nov 14 '23 20:11 horejsek