Skip to content

Commit 9f07296

Browse files
Switch to a MIL-licensed dependency
1 parent d687f55 commit 9f07296

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.1.1
2+
current_version = 0.1.2
33
tag = True
44
tag_name = {new_version}
55
commit = True

openapi_schema_validator/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
__author__ = 'Artur Maciag'
66
__email__ = '[email protected]'
7-
__version__ = '0.1.1'
7+
__version__ = '0.1.2'
88
__url__ = 'https://github.com/p1c2u/openapi-schema-validator'
99
__license__ = 'BSD 3-Clause License'
1010

openapi_schema_validator/_format.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from jsonschema.exceptions import FormatError
88
from six import binary_type, text_type, integer_types
99

10-
DATETIME_HAS_STRICT_RFC3339 = False
10+
DATETIME_HAS_RFC3339_VALIDATOR = False
1111
DATETIME_HAS_ISODATE = False
1212
DATETIME_RAISES = ()
1313

@@ -20,11 +20,11 @@
2020
DATETIME_RAISES += (ValueError, isodate.ISO8601Error)
2121

2222
try:
23-
import strict_rfc3339
23+
from rfc3339_validator import validate_rfc3339
2424
except ImportError:
2525
pass
2626
else:
27-
DATETIME_HAS_STRICT_RFC3339 = True
27+
DATETIME_HAS_RFC3339_VALIDATOR = True
2828
DATETIME_RAISES += (ValueError, TypeError)
2929

3030

@@ -64,8 +64,8 @@ def is_datetime(instance):
6464
if not isinstance(instance, (binary_type, text_type)):
6565
return False
6666

67-
if DATETIME_HAS_STRICT_RFC3339:
68-
return strict_rfc3339.validate_rfc3339(instance)
67+
if DATETIME_HAS_RFC3339_VALIDATOR:
68+
return validate_rfc3339(instance)
6969

7070
if DATETIME_HAS_ISODATE:
7171
return isodate.parse_datetime(instance)

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
isodate
22
jsonschema
33
six
4-
strict_rfc3339
4+
rfc3339-validator

tests/integration/test_validators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def test_nullable(self, schema_type):
3737
])
3838
@mock.patch(
3939
'openapi_schema_validator._format.'
40-
'DATETIME_HAS_STRICT_RFC3339', True
40+
'DATETIME_HAS_RFC3339_VALIDATOR', True
4141
)
4242
@mock.patch(
4343
'openapi_schema_validator._format.'
@@ -58,7 +58,7 @@ def test_string_format_datetime_strict_rfc3339(self, value):
5858
])
5959
@mock.patch(
6060
'openapi_schema_validator._format.'
61-
'DATETIME_HAS_STRICT_RFC3339', False
61+
'DATETIME_HAS_RFC3339_VALIDATOR', False
6262
)
6363
@mock.patch(
6464
'openapi_schema_validator._format.'

0 commit comments

Comments
 (0)