python-fastjsonschema
python-fastjsonschema copied to clipboard
RFC 3339 date month and mday should be two digit
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.
Thanks for finding this. I will probably need to update the test suite to include new tests like this.
Fixed in latest development version, will be part of 2.19.1.