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: 1 addition & 0 deletions openapi_core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core module"""

from openapi_core.app import OpenAPI
from openapi_core.configurations import Config
from openapi_core.shortcuts import unmarshal_apicall_request
Expand Down
1 change: 1 addition & 0 deletions openapi_core/app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core app module"""

from pathlib import Path
from typing import Optional

Expand Down
4 changes: 2 additions & 2 deletions openapi_core/contrib/aiohttp/requests.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"""OpenAPI core contrib aiohttp requests module"""

from __future__ import annotations

from aiohttp import web

from openapi_core.datatypes import RequestParameters


class Empty:
...
class Empty: ...


_empty = Empty()
Expand Down
1 change: 1 addition & 0 deletions openapi_core/contrib/django/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core contrib django module"""

from openapi_core.contrib.django.requests import DjangoOpenAPIRequest
from openapi_core.contrib.django.responses import DjangoOpenAPIResponse

Expand Down
1 change: 1 addition & 0 deletions openapi_core/contrib/django/handlers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core contrib django handlers module"""

from typing import Any
from typing import Callable
from typing import Dict
Expand Down
1 change: 1 addition & 0 deletions openapi_core/contrib/django/middlewares.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core contrib django middlewares module"""

import warnings
from typing import Callable

Expand Down
1 change: 1 addition & 0 deletions openapi_core/contrib/django/requests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core contrib django requests module"""

import re
from typing import Optional

Expand Down
1 change: 1 addition & 0 deletions openapi_core/contrib/django/responses.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core contrib django responses module"""

from itertools import tee

from django.http.response import HttpResponse
Expand Down
1 change: 1 addition & 0 deletions openapi_core/contrib/falcon/handlers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core contrib falcon handlers module"""

from json import dumps
from typing import Any
from typing import Dict
Expand Down
5 changes: 3 additions & 2 deletions openapi_core/contrib/falcon/middlewares.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core contrib falcon middlewares module"""

from typing import Any
from typing import Type
from typing import Union
Expand All @@ -24,9 +25,9 @@

class FalconOpenAPIMiddleware(FalconIntegration):
valid_request_handler_cls = FalconOpenAPIValidRequestHandler
errors_handler_cls: Type[
errors_handler_cls: Type[FalconOpenAPIErrorsHandler] = (
FalconOpenAPIErrorsHandler
] = FalconOpenAPIErrorsHandler
)

def __init__(
self,
Expand Down
1 change: 1 addition & 0 deletions openapi_core/contrib/falcon/requests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core contrib falcon responses module"""

import warnings
from json import dumps
from typing import Any
Expand Down
1 change: 1 addition & 0 deletions openapi_core/contrib/falcon/responses.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core contrib falcon responses module"""

from itertools import tee

from falcon.response import Response
Expand Down
5 changes: 3 additions & 2 deletions openapi_core/contrib/flask/decorators.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core contrib flask decorators module"""

from functools import wraps
from typing import Any
from typing import Callable
Expand All @@ -20,9 +21,9 @@

class FlaskOpenAPIViewDecorator(FlaskIntegration):
valid_request_handler_cls = FlaskOpenAPIValidRequestHandler
errors_handler_cls: Type[
errors_handler_cls: Type[FlaskOpenAPIErrorsHandler] = (
FlaskOpenAPIErrorsHandler
] = FlaskOpenAPIErrorsHandler
)

def __init__(
self,
Expand Down
1 change: 1 addition & 0 deletions openapi_core/contrib/flask/handlers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core contrib flask handlers module"""

from typing import Any
from typing import Callable
from typing import Dict
Expand Down
1 change: 1 addition & 0 deletions openapi_core/contrib/flask/providers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core contrib flask providers module"""

from typing import Any

from flask.globals import request
Expand Down
1 change: 1 addition & 0 deletions openapi_core/contrib/flask/requests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core contrib flask requests module"""

from flask.wrappers import Request
from werkzeug.datastructures import Headers
from werkzeug.datastructures import ImmutableMultiDict
Expand Down
1 change: 1 addition & 0 deletions openapi_core/contrib/flask/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core contrib flask views module"""

from typing import Any

from flask.views import MethodView
Expand Down
1 change: 1 addition & 0 deletions openapi_core/contrib/requests/requests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core contrib requests requests module"""

from typing import Optional
from typing import Union
from urllib.parse import parse_qs
Expand Down
1 change: 1 addition & 0 deletions openapi_core/contrib/requests/responses.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core contrib requests responses module"""

from requests import Response
from werkzeug.datastructures import Headers

Expand Down
1 change: 1 addition & 0 deletions openapi_core/contrib/starlette/handlers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core contrib starlette handlers module"""

from typing import Any
from typing import Dict
from typing import Iterable
Expand Down
8 changes: 5 additions & 3 deletions openapi_core/contrib/starlette/integrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ async def get_openapi_response(
response.body_iterator = body_iter2
data = b"".join(
[
chunk.encode(response.charset)
if not isinstance(chunk, bytes)
else chunk
(
chunk.encode(response.charset)
if not isinstance(chunk, bytes)
else chunk
)
async for chunk in body_iter1
]
)
Expand Down
1 change: 1 addition & 0 deletions openapi_core/contrib/starlette/middlewares.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core contrib starlette middlewares module"""

from starlette.middleware.base import BaseHTTPMiddleware
from starlette.middleware.base import RequestResponseEndpoint
from starlette.requests import Request
Expand Down
1 change: 1 addition & 0 deletions openapi_core/contrib/starlette/requests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core contrib starlette requests module"""

from typing import Optional

from starlette.requests import Request
Expand Down
1 change: 1 addition & 0 deletions openapi_core/contrib/starlette/responses.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core contrib starlette responses module"""

from typing import Optional

from starlette.datastructures import Headers
Expand Down
1 change: 1 addition & 0 deletions openapi_core/contrib/werkzeug/requests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core contrib werkzeug requests module"""

import re
from typing import Optional

Expand Down
1 change: 1 addition & 0 deletions openapi_core/contrib/werkzeug/responses.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core contrib werkzeug responses module"""

from itertools import tee

from werkzeug.datastructures import Headers
Expand Down
1 change: 1 addition & 0 deletions openapi_core/datatypes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core validation request datatypes module"""

from __future__ import annotations

from dataclasses import dataclass
Expand Down
1 change: 1 addition & 0 deletions openapi_core/extensions/models/factories.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI X-Model extension factories module"""

from dataclasses import make_dataclass
from pydoc import locate
from typing import Any
Expand Down
34 changes: 12 additions & 22 deletions openapi_core/protocols.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core protocols module"""

from typing import Any
from typing import Mapping
from typing import Optional
Expand All @@ -13,16 +14,13 @@ class BaseRequest(Protocol):
parameters: RequestParameters

@property
def method(self) -> str:
...
def method(self) -> str: ...

@property
def body(self) -> Optional[bytes]:
...
def body(self) -> Optional[bytes]: ...

@property
def content_type(self) -> str:
...
def content_type(self) -> str: ...


@runtime_checkable
Expand Down Expand Up @@ -54,12 +52,10 @@ class Request(BaseRequest, Protocol):
"""

@property
def host_url(self) -> str:
...
def host_url(self) -> str: ...

@property
def path(self) -> str:
...
def path(self) -> str: ...


@runtime_checkable
Expand All @@ -82,8 +78,7 @@ class WebhookRequest(BaseRequest, Protocol):
"""

@property
def name(self) -> str:
...
def name(self) -> str: ...


@runtime_checkable
Expand All @@ -100,8 +95,7 @@ class SupportsPathPattern(Protocol):
"""

@property
def path_pattern(self) -> str:
...
def path_pattern(self) -> str: ...


@runtime_checkable
Expand All @@ -120,17 +114,13 @@ class Response(Protocol):
"""

@property
def data(self) -> Optional[bytes]:
...
def data(self) -> Optional[bytes]: ...

@property
def status_code(self) -> int:
...
def status_code(self) -> int: ...

@property
def content_type(self) -> str:
...
def content_type(self) -> str: ...

@property
def headers(self) -> Mapping[str, Any]:
...
def headers(self) -> Mapping[str, Any]: ...
6 changes: 2 additions & 4 deletions openapi_core/schema/protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@

@runtime_checkable
class SuportsGetAll(Protocol):
def getall(self, name: str) -> List[Any]:
...
def getall(self, name: str) -> List[Any]: ...


@runtime_checkable
class SuportsGetList(Protocol):
def getlist(self, name: str) -> List[Any]:
...
def getlist(self, name: str) -> List[Any]: ...
1 change: 1 addition & 0 deletions openapi_core/shortcuts.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core shortcuts module"""

from typing import Any
from typing import Optional
from typing import Union
Expand Down
1 change: 1 addition & 0 deletions openapi_core/templating/media_types/finders.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core templating media types finders module"""

import fnmatch
from typing import Mapping
from typing import Tuple
Expand Down
1 change: 1 addition & 0 deletions openapi_core/templating/paths/datatypes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core templating paths datatypes module"""

from collections import namedtuple

Path = namedtuple("Path", ["path", "path_result"])
Expand Down
1 change: 1 addition & 0 deletions openapi_core/templating/paths/finders.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core templating paths finders module"""

from typing import Iterator
from typing import List
from typing import Optional
Expand Down
1 change: 1 addition & 0 deletions openapi_core/testing/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core testing module"""

from openapi_core.testing.requests import MockRequest
from openapi_core.testing.responses import MockResponse

Expand Down
1 change: 1 addition & 0 deletions openapi_core/testing/requests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core testing requests module"""

from typing import Any
from typing import Dict
from typing import Optional
Expand Down
1 change: 1 addition & 0 deletions openapi_core/testing/responses.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core testing responses module"""

from typing import Any
from typing import Dict
from typing import Optional
Expand Down
1 change: 1 addition & 0 deletions openapi_core/unmarshalling/datatypes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core validation datatypes module"""

from dataclasses import dataclass
from typing import Iterable

Expand Down
1 change: 1 addition & 0 deletions openapi_core/unmarshalling/integrations.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core unmarshalling processors module"""

from typing import Generic

from openapi_core.app import OpenAPI
Expand Down
1 change: 1 addition & 0 deletions openapi_core/unmarshalling/processors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core unmarshalling processors module"""

from openapi_core.typing import RequestType
from openapi_core.typing import ResponseType
from openapi_core.unmarshalling.integrations import (
Expand Down
1 change: 1 addition & 0 deletions openapi_core/unmarshalling/request/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core unmarshalling request module"""

from typing import Mapping

from openapi_spec_validator.versions import consts as versions
Expand Down
1 change: 1 addition & 0 deletions openapi_core/unmarshalling/request/datatypes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenAPI core unmarshalling request datatypes module"""

from __future__ import annotations

from dataclasses import dataclass
Expand Down
Loading