Skip to content

Commit

Permalink
Fix date pattern regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
Yarin78 committed Dec 2, 2024
1 parent 3e0075c commit e8e34c8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion fastjsonschema/draft07.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class CodeGeneratorDraft07(CodeGeneratorDraft06):
FORMAT_REGEXS = dict(CodeGeneratorDraft06.FORMAT_REGEXS, **{
'date': r'^(?P<year>\d{4})-(?P<month>(0[1-9]|1[1-2]))-(?P<day>(0[1-9]|[12]\d|3[01]))\Z',
'date': r'^(?P<year>\d{4})-(?P<month>(0[1-9]|1[0-2]))-(?P<day>(0[1-9]|[12]\d|3[01]))\Z',
'iri': r'^\w+:(\/?\/?)[^\s]+\Z',
'iri-reference': r'^(\w+:(\/?\/?))?[^#\\\s]*(#[^\\\s]*)?\Z',
'idn-email': r'^[^@]+@[^@]+\.[^@]+\Z',
Expand Down
1 change: 1 addition & 0 deletions tests/test_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def test_hostname(asserter, value, expected):
('bla', exc),
('2018-2-5', exc),
('2018-02-05', '2018-02-05'),
('2018-10-31', '2018-10-31'),
])
def test_date(asserter, value, expected):
asserter({
Expand Down

0 comments on commit e8e34c8

Please sign in to comment.