Move schema validator to separate subpackage

This commit is contained in:
Artur Maciag 2020-01-28 09:51:09 +00:00
parent c3f9adadaa
commit 6b6abc0b01
7 changed files with 12 additions and 8 deletions

View file

@ -5,11 +5,11 @@ import re
from jsonschema.exceptions import ValidationError
from openapi_core.schema.schemas._format import oas30_format_checker
from openapi_core.schema_validator import OAS30Validator
from openapi_core.schema_validator import oas30_format_checker
from openapi_core.schema.schemas.enums import SchemaType
from openapi_core.schema.schemas.exceptions import InvalidSchemaValue
from openapi_core.schema.schemas.types import NoValue
from openapi_core.schema.schemas.validators import OAS30Validator
from openapi_core.unmarshalling.schemas.exceptions import (
UnmarshalValueError,
)

View file

@ -0,0 +1,4 @@
from openapi_core.schema_validator._format import oas30_format_checker
from openapi_core.schema_validator.validators import OAS30Validator
__all__ = ['OAS30Validator', 'oas30_format_checker']

View file

@ -1,8 +1,8 @@
from jsonschema import _legacy_validators, _utils, _validators
from jsonschema.validators import create
from openapi_core.schema.schemas import _types as oas_types
from openapi_core.schema.schemas import _validators as oas_validators
from openapi_core.schema_validator import _types as oas_types
from openapi_core.schema_validator import _validators as oas_validators
BaseOAS30Validator = create(

View file

@ -621,11 +621,11 @@ class TestSchemaValidate(object):
u('2018-01-02T23:59:59Z'),
])
@mock.patch(
'openapi_core.schema.schemas._format.'
'openapi_core.schema_validator._format.'
'DATETIME_HAS_STRICT_RFC3339', True
)
@mock.patch(
'openapi_core.schema.schemas._format.'
'openapi_core.schema_validator._format.'
'DATETIME_HAS_ISODATE', False
)
def test_string_format_datetime_strict_rfc3339(self, value):
@ -640,11 +640,11 @@ class TestSchemaValidate(object):
u('2018-01-02T23:59:59Z'),
])
@mock.patch(
'openapi_core.schema.schemas._format.'
'openapi_core.schema_validator._format.'
'DATETIME_HAS_STRICT_RFC3339', False
)
@mock.patch(
'openapi_core.schema.schemas._format.'
'openapi_core.schema_validator._format.'
'DATETIME_HAS_ISODATE', True
)
def test_string_format_datetime_isodate(self, value):