Skip to content

Commit 14cf7af

Browse files
committed
Added partial support of idn-hostname format
1 parent bb03f7c commit 14cf7af

File tree

6 files changed

+2
-6
lines changed

6 files changed

+2
-6
lines changed

CHANGELOG.txt

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* Improved regexp for email format to comfort test suite
88
* Improved regexp for date format to comfort test suite
99
* Improved regexp for ipv4 format to comfort test suite
10+
* Added partial support of idn-hostname format
1011

1112
=== 2.20.0 (2024-06-15)
1213

fastjsonschema/draft07.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class CodeGeneratorDraft07(CodeGeneratorDraft06):
77
'iri': r'^\w+:(\/?\/?)[^\s]+\Z',
88
'iri-reference': r'^(\w+:(\/?\/?))?[^#\\\s]*(#[^\\\s]*)?\Z',
99
'idn-email': r'^[^@]+@[^@]+\.[^@]+\Z',
10-
#'idn-hostname': r'',
10+
'idn-hostname': r'^(?!-)(xn--)?[a-zA-Z0-9][a-zA-Z0-9-_]{0,61}[a-zA-Z0-9]{0,1}\.(?!-)(xn--)?([a-zA-Z0-9\-]{1,50}|[a-zA-Z0-9-]{1,30}\.[a-zA-Z]{2,})$',
1111
'relative-json-pointer': r'^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)\Z',
1212
#'regex': r'',
1313
'time': (

tests/json_schema/test_draft04.py

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ def pytest_generate_tests(metafunc):
2323
# TODO: fix formats
2424
'ipv6.json',
2525
'time.json',
26-
'format.json',
2726

2827
# TODO: fix ref
2928
'ref.json',

tests/json_schema/test_draft06.py

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ def pytest_generate_tests(metafunc):
2323
# TODO: fix formats
2424
'ipv6.json',
2525
'time.json',
26-
'format.json',
2726

2827
# TODO: fix ref
2928
'ref.json',

tests/json_schema/test_draft07.py

-2
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ def pytest_generate_tests(metafunc):
2424
'enum.json',
2525

2626
# TODO: fix formats
27-
#'ipv4.json',
2827
'ipv6.json',
2928
'time.json',
30-
'format.json',
3129

3230
# TODO: fix ref
3331
'ref.json',

tests/json_schema/test_draft2019.py

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ def pytest_generate_tests(metafunc):
2626
# TODO: fix formats
2727
'ipv6.json',
2828
'time.json',
29-
'format.json',
3029

3130
# TODO: fix ref
3231
'ref.json',

0 commit comments

Comments
 (0)