Skip to content

Commit 193838a

Browse files
committedSep 12, 2018
Allow date-time strings without milliseconds. Fixes horejsek#23
1 parent e903369 commit 193838a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎fastjsonschema/draft04.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
class CodeGeneratorDraft04(CodeGenerator):
1919
# pylint: disable=line-too-long
2020
FORMAT_REGEXS = {
21-
'date-time': r'^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+(?:[+-][0-2]\d:[0-5]\d|Z)?$',
21+
'date-time': r'^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:[+-][0-2]\d:[0-5]\d|Z)?$',
2222
'email': r'^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$',
2323
'hostname': (
2424
r'^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*'

0 commit comments

Comments
 (0)