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
1 change: 0 additions & 1 deletion openapi_core/casting/schemas/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


class SchemaCastersFactory:

DUMMY_CASTERS = [
"string",
"object",
Expand Down
1 change: 0 additions & 1 deletion openapi_core/contrib/django/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@


class DjangoOpenAPIErrorsHandler:

OPENAPI_ERROR_STATUS: Dict[Type[BaseException], int] = {
ServerNotFound: 400,
SecurityNotFound: 403,
Expand Down
1 change: 0 additions & 1 deletion openapi_core/contrib/django/middlewares.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@


class DjangoOpenAPIMiddleware:

request_class = DjangoOpenAPIRequest
response_class = DjangoOpenAPIResponse
errors_handler = DjangoOpenAPIErrorsHandler()
Expand Down
1 change: 0 additions & 1 deletion openapi_core/contrib/django/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@


class DjangoOpenAPIRequest:

path_regex = re.compile(PATH_PARAMETER_PATTERN)

def __init__(self, request: HttpRequest):
Expand Down
1 change: 0 additions & 1 deletion openapi_core/contrib/falcon/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@


class FalconOpenAPIErrorsHandler:

OPENAPI_ERROR_STATUS: Dict[Type[BaseException], int] = {
ServerNotFound: 400,
SecurityNotFound: 403,
Expand Down
1 change: 0 additions & 1 deletion openapi_core/contrib/falcon/middlewares.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@


class FalconOpenAPIMiddleware(OpenAPIProcessor):

request_class = FalconOpenAPIRequest
response_class = FalconOpenAPIResponse
errors_handler = FalconOpenAPIErrorsHandler()
Expand Down
1 change: 0 additions & 1 deletion openapi_core/contrib/flask/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@


class FlaskOpenAPIErrorsHandler:

OPENAPI_ERROR_STATUS: Dict[Type[BaseException], int] = {
ServerNotFound: 400,
SecurityNotFound: 403,
Expand Down
1 change: 0 additions & 1 deletion openapi_core/contrib/werkzeug/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@


class WerkzeugOpenAPIRequest:

path_regex = re.compile(PATH_PARAMETER_PATTERN)

def __init__(self, request: Request):
Expand Down
1 change: 0 additions & 1 deletion openapi_core/deserializing/media_types/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@


class MediaTypeDeserializersFactory:

MEDIA_TYPE_DESERIALIZERS: Dict[str, DeserializerCallable] = {
"application/json": loads,
"application/x-www-form-urlencoded": urlencoded_form_loads,
Expand Down
1 change: 0 additions & 1 deletion openapi_core/deserializing/parameters/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@


class ParameterDeserializersFactory:

PARAMETER_STYLE_DESERIALIZERS: Dict[str, DeserializerCallable] = {
"form": partial(split, separator=","),
"simple": partial(split, separator=","),
Expand Down
1 change: 0 additions & 1 deletion openapi_core/extensions/models/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@


class DictFactory:

base_class = dict

def create(
Expand Down
1 change: 0 additions & 1 deletion openapi_core/security/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


class SecurityProviderFactory:

PROVIDERS: Dict[str, Type[BaseProvider]] = {
"apiKey": ApiKeyProvider,
"http": HttpProvider,
Expand Down
1 change: 0 additions & 1 deletion openapi_core/templating/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ def _handle_field(self, field: str) -> Any:


class PathParameter:

name = "PathParameter"
pattern = r"[^\/]+"

Expand Down
2 changes: 0 additions & 2 deletions openapi_core/unmarshalling/schemas/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@


class SchemaValidatorsFactory:

CONTEXTS = {
ValidationContext.REQUEST: "write",
ValidationContext.RESPONSE: "read",
Expand Down Expand Up @@ -83,7 +82,6 @@ def create(self, schema: Spec) -> Validator:


class SchemaUnmarshallersFactory:

UNMARSHALLERS: Dict[str, Type[BaseSchemaUnmarshaller]] = {
"string": StringUnmarshaller,
"integer": IntegerUnmarshaller,
Expand Down
9 changes: 0 additions & 9 deletions openapi_core/unmarshalling/schemas/unmarshallers.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@


class BaseSchemaUnmarshaller:

FORMATTERS: FormattersDict = {
None: Formatter(),
}
Expand Down Expand Up @@ -198,7 +197,6 @@ def _iter_all_of_schemas(


class StringUnmarshaller(BaseSchemaUnmarshaller):

FORMATTERS: FormattersDict = {
None: Formatter.from_callables(partial(is_string, None), str),
"password": Formatter.from_callables(
Expand All @@ -224,7 +222,6 @@ class StringUnmarshaller(BaseSchemaUnmarshaller):


class IntegerUnmarshaller(BaseSchemaUnmarshaller):

FORMATTERS: FormattersDict = {
None: Formatter.from_callables(partial(is_integer, None), int),
"int32": Formatter.from_callables(
Expand All @@ -237,7 +234,6 @@ class IntegerUnmarshaller(BaseSchemaUnmarshaller):


class NumberUnmarshaller(BaseSchemaUnmarshaller):

FORMATTERS: FormattersDict = {
None: Formatter.from_callables(
partial(is_number, None), format_number
Expand All @@ -252,14 +248,12 @@ class NumberUnmarshaller(BaseSchemaUnmarshaller):


class BooleanUnmarshaller(BaseSchemaUnmarshaller):

FORMATTERS: FormattersDict = {
None: Formatter.from_callables(partial(is_bool, None), forcebool),
}


class NullUnmarshaller(BaseSchemaUnmarshaller):

FORMATTERS: FormattersDict = {
None: Formatter.from_callables(partial(is_null, None), None),
}
Expand All @@ -286,7 +280,6 @@ def __init__(


class ArrayUnmarshaller(ComplexUnmarshaller):

FORMATTERS: FormattersDict = {
None: Formatter.from_callables(partial(is_array, None), list),
}
Expand All @@ -305,7 +298,6 @@ def unmarshal(self, value: Any) -> Optional[List[Any]]:


class ObjectUnmarshaller(ComplexUnmarshaller):

FORMATTERS: FormattersDict = {
None: Formatter.from_callables(partial(is_object, None), dict),
}
Expand Down Expand Up @@ -439,7 +431,6 @@ def unmarshal(self, value: Any) -> Any:


class AnyUnmarshaller(MultiTypeUnmarshaller):

SCHEMA_TYPES_ORDER = [
"object",
"array",
Expand Down
1 change: 0 additions & 1 deletion openapi_core/validation/request/protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

@runtime_checkable
class BaseRequest(Protocol):

parameters: RequestParameters

@property
Expand Down
1 change: 0 additions & 1 deletion openapi_core/validation/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@


class BaseValidator:

schema_unmarshallers_factory: SchemaUnmarshallersFactory = NotImplemented

def __init__(
Expand Down
70 changes: 33 additions & 37 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ requests = ["requests"]
starlette = ["starlette", "httpx"]

[tool.poetry.dev-dependencies]
black = "^22.12.0"
black = "^23.1.0"
django = ">=3.0"
djangorestframework = "^3.11.2"
falcon = ">=3.0"
Expand Down
1 change: 0 additions & 1 deletion tests/integration/contrib/django/test_django_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class BaseTestDjangoProject:

api_key = "12345"

@property
Expand Down
1 change: 0 additions & 1 deletion tests/integration/contrib/falcon/test_falcon_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class BaseTestFalconProject:

api_key = "12345"

@property
Expand Down
1 change: 0 additions & 1 deletion tests/integration/contrib/flask/test_flask_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class TestFlaskOpenAPIDecorator:

view_response_callable = None

@pytest.fixture
Expand Down
1 change: 0 additions & 1 deletion tests/integration/contrib/flask/test_flask_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class TestFlaskOpenAPIView:

view_response = None

@pytest.fixture
Expand Down
2 changes: 0 additions & 2 deletions tests/integration/schema/test_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@


class TestPetstore:

api_key = "12345"

@property
Expand Down Expand Up @@ -340,7 +339,6 @@ def response_validator(self, spec):
return ResponseValidator(spec)

def test_spec(self, spec, spec_dict):

info = spec / "info"
info_spec = spec_dict["info"]
assert info["title"] == info_spec["title"]
Expand Down
1 change: 0 additions & 1 deletion tests/integration/validation/test_minimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class TestMinimal:

servers = [
"http://minimal.test/",
"https://bad.remote.domain.net/",
Expand Down
1 change: 0 additions & 1 deletion tests/integration/validation/test_petstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@


class TestPetstore:

api_key = "12345"

@property
Expand Down
Loading