Skip to content

Commit e8e34c8

Browse files
committed
Fix date pattern regexp
1 parent 3e0075c commit e8e34c8

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

fastjsonschema/draft07.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
class CodeGeneratorDraft07(CodeGeneratorDraft06):
55
FORMAT_REGEXS = dict(CodeGeneratorDraft06.FORMAT_REGEXS, **{
6-
'date': r'^(?P<year>\d{4})-(?P<month>(0[1-9]|1[1-2]))-(?P<day>(0[1-9]|[12]\d|3[01]))\Z',
6+
'date': r'^(?P<year>\d{4})-(?P<month>(0[1-9]|1[0-2]))-(?P<day>(0[1-9]|[12]\d|3[01]))\Z',
77
'iri': r'^\w+:(\/?\/?)[^\s]+\Z',
88
'iri-reference': r'^(\w+:(\/?\/?))?[^#\\\s]*(#[^\\\s]*)?\Z',
99
'idn-email': r'^[^@]+@[^@]+\.[^@]+\Z',

tests/test_format.py

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def test_hostname(asserter, value, expected):
4343
('bla', exc),
4444
('2018-2-5', exc),
4545
('2018-02-05', '2018-02-05'),
46+
('2018-10-31', '2018-10-31'),
4647
])
4748
def test_date(asserter, value, expected):
4849
asserter({

0 commit comments

Comments
 (0)