Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions openapi_core/casting/schemas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
oas30_write_schema_validators_factory,
)
from openapi_core.validation.schemas import oas31_schema_validators_factory
from openapi_core.validation.schemas import oas32_schema_validators_factory

__all__ = [
"oas30_write_schema_casters_factory",
"oas30_read_schema_casters_factory",
"oas31_schema_casters_factory",
"oas32_schema_casters_factory",
]

oas30_casters_dict = OrderedDict(
Expand Down Expand Up @@ -48,6 +50,7 @@
PrimitiveCaster,
multi=PrimitiveCaster,
)
oas32_types_caster = oas31_types_caster

oas30_write_schema_casters_factory = SchemaCastersFactory(
oas30_write_schema_validators_factory,
Expand All @@ -63,3 +66,7 @@
oas31_schema_validators_factory,
oas31_types_caster,
)
oas32_schema_casters_factory = SchemaCastersFactory(
oas32_schema_validators_factory,
oas32_types_caster,
)
4 changes: 3 additions & 1 deletion openapi_core/unmarshalling/schemas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
__all__ = [
"oas30_format_unmarshallers",
"oas31_format_unmarshallers",
"oas32_format_unmarshallers",
"oas30_write_schema_unmarshallers_factory",
"oas30_read_schema_unmarshallers_factory",
"oas31_schema_unmarshallers_factory",
Expand Down Expand Up @@ -67,6 +68,7 @@
AnyUnmarshaller,
multi=MultiTypeUnmarshaller,
)
oas32_types_unmarshaller = oas31_types_unmarshaller

oas30_format_unmarshallers = {
# string compatible
Expand Down Expand Up @@ -102,7 +104,7 @@

oas32_schema_unmarshallers_factory = SchemaUnmarshallersFactory(
oas32_schema_validators_factory,
oas31_types_unmarshaller,
oas32_types_unmarshaller,
format_unmarshallers=oas32_format_unmarshallers,
)

Expand Down
17 changes: 9 additions & 8 deletions openapi_core/validation/request/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from openapi_core.casting.schemas import oas30_write_schema_casters_factory
from openapi_core.casting.schemas import oas31_schema_casters_factory
from openapi_core.casting.schemas import oas32_schema_casters_factory
from openapi_core.casting.schemas.factories import SchemaCastersFactory
from openapi_core.datatypes import Parameters
from openapi_core.datatypes import RequestParameters
Expand Down Expand Up @@ -482,47 +483,47 @@ class V31WebhookRequestValidator(WebhookRequestValidator):

class V32RequestBodyValidator(APICallRequestBodyValidator):
spec_validator_cls = OpenAPIV32SpecValidator
schema_casters_factory = oas31_schema_casters_factory
schema_casters_factory = oas32_schema_casters_factory
schema_validators_factory = oas32_schema_validators_factory


class V32RequestParametersValidator(APICallRequestParametersValidator):
spec_validator_cls = OpenAPIV32SpecValidator
schema_casters_factory = oas31_schema_casters_factory
schema_casters_factory = oas32_schema_casters_factory
schema_validators_factory = oas32_schema_validators_factory


class V32RequestSecurityValidator(APICallRequestSecurityValidator):
spec_validator_cls = OpenAPIV32SpecValidator
schema_casters_factory = oas31_schema_casters_factory
schema_casters_factory = oas32_schema_casters_factory
schema_validators_factory = oas32_schema_validators_factory


class V32RequestValidator(APICallRequestValidator):
spec_validator_cls = OpenAPIV32SpecValidator
schema_casters_factory = oas31_schema_casters_factory
schema_casters_factory = oas32_schema_casters_factory
schema_validators_factory = oas32_schema_validators_factory


class V32WebhookRequestBodyValidator(WebhookRequestBodyValidator):
spec_validator_cls = OpenAPIV32SpecValidator
schema_casters_factory = oas31_schema_casters_factory
schema_casters_factory = oas32_schema_casters_factory
schema_validators_factory = oas32_schema_validators_factory


class V32WebhookRequestParametersValidator(WebhookRequestParametersValidator):
spec_validator_cls = OpenAPIV32SpecValidator
schema_casters_factory = oas31_schema_casters_factory
schema_casters_factory = oas32_schema_casters_factory
schema_validators_factory = oas32_schema_validators_factory


class V32WebhookRequestSecurityValidator(WebhookRequestSecurityValidator):
spec_validator_cls = OpenAPIV32SpecValidator
schema_casters_factory = oas31_schema_casters_factory
schema_casters_factory = oas32_schema_casters_factory
schema_validators_factory = oas32_schema_validators_factory


class V32WebhookRequestValidator(WebhookRequestValidator):
spec_validator_cls = OpenAPIV32SpecValidator
schema_casters_factory = oas31_schema_casters_factory
schema_casters_factory = oas32_schema_casters_factory
schema_validators_factory = oas32_schema_validators_factory
13 changes: 7 additions & 6 deletions openapi_core/validation/response/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

from openapi_core.casting.schemas import oas30_read_schema_casters_factory
from openapi_core.casting.schemas import oas31_schema_casters_factory
from openapi_core.casting.schemas import oas32_schema_casters_factory
from openapi_core.exceptions import OpenAPIError
from openapi_core.protocols import HeadersType
from openapi_core.protocols import Request
Expand Down Expand Up @@ -410,35 +411,35 @@ class V31WebhookResponseValidator(WebhookResponseValidator):

class V32ResponseDataValidator(APICallResponseDataValidator):
spec_validator_cls = OpenAPIV32SpecValidator
schema_casters_factory = oas31_schema_casters_factory
schema_casters_factory = oas32_schema_casters_factory
schema_validators_factory = oas32_schema_validators_factory


class V32ResponseHeadersValidator(APICallResponseHeadersValidator):
spec_validator_cls = OpenAPIV32SpecValidator
schema_casters_factory = oas31_schema_casters_factory
schema_casters_factory = oas32_schema_casters_factory
schema_validators_factory = oas32_schema_validators_factory


class V32ResponseValidator(APICallResponseValidator):
spec_validator_cls = OpenAPIV32SpecValidator
schema_casters_factory = oas31_schema_casters_factory
schema_casters_factory = oas32_schema_casters_factory
schema_validators_factory = oas32_schema_validators_factory


class V32WebhookResponseDataValidator(WebhookResponseDataValidator):
spec_validator_cls = OpenAPIV32SpecValidator
schema_casters_factory = oas31_schema_casters_factory
schema_casters_factory = oas32_schema_casters_factory
schema_validators_factory = oas32_schema_validators_factory


class V32WebhookResponseHeadersValidator(WebhookResponseHeadersValidator):
spec_validator_cls = OpenAPIV32SpecValidator
schema_casters_factory = oas31_schema_casters_factory
schema_casters_factory = oas32_schema_casters_factory
schema_validators_factory = oas32_schema_validators_factory


class V32WebhookResponseValidator(WebhookResponseValidator):
spec_validator_cls = OpenAPIV32SpecValidator
schema_casters_factory = oas31_schema_casters_factory
schema_casters_factory = oas32_schema_casters_factory
schema_validators_factory = oas32_schema_validators_factory
Loading