New schema package

This commit is contained in:
p1c2u 2021-04-27 22:39:28 +01:00
parent 74e33bac23
commit d8a36cc998
20 changed files with 35 additions and 11 deletions

View file

@ -1,3 +1,5 @@
from __future__ import division
from openapi_core.casting.schemas.exceptions import CastError from openapi_core.casting.schemas.exceptions import CastError
from openapi_core.types import NoValue from openapi_core.types import NoValue

View file

@ -2,7 +2,7 @@ from openapi_core.deserializing.exceptions import DeserializeError
from openapi_core.deserializing.parameters.exceptions import ( from openapi_core.deserializing.parameters.exceptions import (
EmptyParameterValue, EmptyParameterValue,
) )
from openapi_core.spec.parameters import get_aslist, get_explode, get_style from openapi_core.schema.parameters import get_aslist, get_explode, get_style
class PrimitiveDeserializer(object): class PrimitiveDeserializer(object):

View file

View file

@ -1,3 +1,5 @@
from __future__ import division
from six import iteritems from six import iteritems

View file

@ -1,3 +1,5 @@
from __future__ import division
from six import iteritems from six import iteritems

View file

@ -1,4 +1,6 @@
from openapi_core.spec.servers import get_server_url from __future__ import division
from openapi_core.schema.servers import get_server_url
def get_spec_url(spec, index=0): def get_spec_url(spec, index=0):

View file

@ -8,9 +8,7 @@ SPEC_SEPARATOR = '#'
class SpecPath(AccessorPath): class SpecPath(AccessorPath):
@classmethod @classmethod
def from_spec( def from_spec(cls, spec_dict, dereferencer=None, *args, **kwargs):
cls, spec_dict, dereferencer=None, *args, separator = kwargs.pop('separator', SPEC_SEPARATOR)
separator=SPEC_SEPARATOR,
):
accessor = SpecAccessor(spec_dict, dereferencer) accessor = SpecAccessor(spec_dict, dereferencer)
return cls(accessor, *args, separator=separator) return cls(accessor, *args, separator=separator)

View file

@ -1,4 +1,5 @@
"""OpenAPI core templating media types finders module""" """OpenAPI core templating media types finders module"""
from __future__ import division
import fnmatch import fnmatch
from six import iteritems from six import iteritems

View file

@ -1,9 +1,11 @@
"""OpenAPI core templating paths finders module""" """OpenAPI core templating paths finders module"""
from __future__ import division
from more_itertools import peekable from more_itertools import peekable
from six import iteritems from six import iteritems
from six.moves.urllib.parse import urljoin, urlparse from six.moves.urllib.parse import urljoin, urlparse
from openapi_core.spec.servers import is_absolute from openapi_core.schema.servers import is_absolute
from openapi_core.templating.datatypes import TemplateResult from openapi_core.templating.datatypes import TemplateResult
from openapi_core.templating.util import parse, search from openapi_core.templating.util import parse, search
from openapi_core.templating.paths.exceptions import ( from openapi_core.templating.paths.exceptions import (

View file

@ -1,3 +1,5 @@
from __future__ import division
from openapi_core.templating.responses.exceptions import ResponseNotFound from openapi_core.templating.responses.exceptions import ResponseNotFound

View file

@ -1,3 +1,4 @@
from __future__ import division
from functools import partial from functools import partial
import logging import logging
@ -12,7 +13,7 @@ from six import text_type, binary_type
from six import iteritems from six import iteritems
from openapi_core.extensions.models.factories import ModelFactory from openapi_core.extensions.models.factories import ModelFactory
from openapi_core.spec.schemas import ( from openapi_core.schema.schemas import (
get_all_properties, get_all_properties_names get_all_properties, get_all_properties_names
) )
from openapi_core.types import NoValue from openapi_core.types import NoValue

View file

@ -1,4 +1,5 @@
"""OpenAPI core validation request validators module""" """OpenAPI core validation request validators module"""
from __future__ import division
from itertools import chain from itertools import chain
from six import iteritems from six import iteritems
@ -8,7 +9,7 @@ from openapi_core.exceptions import (
MissingRequiredParameter, MissingParameter, MissingRequestBody, MissingRequiredParameter, MissingParameter, MissingRequestBody,
) )
from openapi_core.security.exceptions import SecurityError from openapi_core.security.exceptions import SecurityError
from openapi_core.spec.parameters import get_aslist, get_explode from openapi_core.schema.parameters import get_aslist, get_explode
from openapi_core.templating.media_types.exceptions import MediaTypeFinderError from openapi_core.templating.media_types.exceptions import MediaTypeFinderError
from openapi_core.templating.paths.exceptions import PathError from openapi_core.templating.paths.exceptions import PathError
from openapi_core.unmarshalling.schemas.enums import UnmarshalContext from openapi_core.unmarshalling.schemas.enums import UnmarshalContext

View file

@ -1,4 +1,6 @@
"""OpenAPI core validation response validators module""" """OpenAPI core validation response validators module"""
from __future__ import division
from openapi_core.casting.schemas.exceptions import CastError from openapi_core.casting.schemas.exceptions import CastError
from openapi_core.deserializing.exceptions import DeserializeError from openapi_core.deserializing.exceptions import DeserializeError
from openapi_core.exceptions import MissingResponseContent from openapi_core.exceptions import MissingResponseContent

View file

@ -1,4 +1,6 @@
"""OpenAPI core validation validators module""" """OpenAPI core validation validators module"""
from __future__ import division
from openapi_core.unmarshalling.schemas.util import build_format_checker from openapi_core.unmarshalling.schemas.util import build_format_checker

View file

@ -1,3 +1,5 @@
from __future__ import division
from openapi_core.shortcuts import create_spec from openapi_core.shortcuts import create_spec

View file

@ -1,3 +1,5 @@
from __future__ import division
import pytest import pytest
from openapi_core.shortcuts import create_spec from openapi_core.shortcuts import create_spec

View file

@ -1,10 +1,11 @@
from __future__ import division
import pytest import pytest
from base64 import b64encode from base64 import b64encode
from six import iteritems, text_type from six import iteritems, text_type
from openapi_core.shortcuts import create_spec from openapi_core.shortcuts import create_spec
from openapi_core.spec.servers import get_server_url from openapi_core.schema.servers import get_server_url
from openapi_core.spec.specs import get_spec_url from openapi_core.schema.specs import get_spec_url
from openapi_core.validation.request.validators import RequestValidator from openapi_core.validation.request.validators import RequestValidator
from openapi_core.validation.response.validators import ResponseValidator from openapi_core.validation.response.validators import ResponseValidator

View file

@ -1,3 +1,4 @@
from __future__ import division
import pytest import pytest
from openapi_core.spec.paths import SpecPath from openapi_core.spec.paths import SpecPath

View file

@ -1,3 +1,4 @@
from __future__ import division
import mock import mock
import pytest import pytest