Skip to content

Commit 6b6abc0

Browse files
committed
Move schema validator to separate subpackage
1 parent c3f9ada commit 6b6abc0

File tree

7 files changed

+12
-8
lines changed

7 files changed

+12
-8
lines changed

openapi_core/schema/schemas/models.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
from jsonschema.exceptions import ValidationError
77

8-
from openapi_core.schema.schemas._format import oas30_format_checker
8+
from openapi_core.schema_validator import OAS30Validator
9+
from openapi_core.schema_validator import oas30_format_checker
910
from openapi_core.schema.schemas.enums import SchemaType
1011
from openapi_core.schema.schemas.exceptions import InvalidSchemaValue
1112
from openapi_core.schema.schemas.types import NoValue
12-
from openapi_core.schema.schemas.validators import OAS30Validator
1313
from openapi_core.unmarshalling.schemas.exceptions import (
1414
UnmarshalValueError,
1515
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from openapi_core.schema_validator._format import oas30_format_checker
2+
from openapi_core.schema_validator.validators import OAS30Validator
3+
4+
__all__ = ['OAS30Validator', 'oas30_format_checker']

openapi_core/schema/schemas/validators.py renamed to openapi_core/schema_validator/validators.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from jsonschema import _legacy_validators, _utils, _validators
22
from jsonschema.validators import create
33

4-
from openapi_core.schema.schemas import _types as oas_types
5-
from openapi_core.schema.schemas import _validators as oas_validators
4+
from openapi_core.schema_validator import _types as oas_types
5+
from openapi_core.schema_validator import _validators as oas_validators
66

77

88
BaseOAS30Validator = create(

tests/unit/schema/test_schemas.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -621,11 +621,11 @@ def test_string_format_datetime_invalid(self, value):
621621
u('2018-01-02T23:59:59Z'),
622622
])
623623
@mock.patch(
624-
'openapi_core.schema.schemas._format.'
624+
'openapi_core.schema_validator._format.'
625625
'DATETIME_HAS_STRICT_RFC3339', True
626626
)
627627
@mock.patch(
628-
'openapi_core.schema.schemas._format.'
628+
'openapi_core.schema_validator._format.'
629629
'DATETIME_HAS_ISODATE', False
630630
)
631631
def test_string_format_datetime_strict_rfc3339(self, value):
@@ -640,11 +640,11 @@ def test_string_format_datetime_strict_rfc3339(self, value):
640640
u('2018-01-02T23:59:59Z'),
641641
])
642642
@mock.patch(
643-
'openapi_core.schema.schemas._format.'
643+
'openapi_core.schema_validator._format.'
644644
'DATETIME_HAS_STRICT_RFC3339', False
645645
)
646646
@mock.patch(
647-
'openapi_core.schema.schemas._format.'
647+
'openapi_core.schema_validator._format.'
648648
'DATETIME_HAS_ISODATE', True
649649
)
650650
def test_string_format_datetime_isodate(self, value):

0 commit comments

Comments
 (0)