-
-
Notifications
You must be signed in to change notification settings - Fork 133
/
Copy pathprotocols.py
40 lines (30 loc) · 1004 Bytes
/
protocols.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
"""OpenAPI core validation request protocols module"""
from typing import Optional
from typing import Protocol
from typing import runtime_checkable
from jsonschema_path import SchemaPath
from openapi_core.protocols import Request
from openapi_core.protocols import WebhookRequest
from openapi_core.unmarshalling.request.datatypes import RequestUnmarshalResult
@runtime_checkable
class RequestUnmarshaller(Protocol):
def __init__(self, spec: SchemaPath, base_url: Optional[str] = None):
...
def check_spec(self, spec: SchemaPath) -> None:
...
def unmarshal(
self,
request: Request,
) -> RequestUnmarshalResult:
...
@runtime_checkable
class WebhookRequestUnmarshaller(Protocol):
def __init__(self, spec: SchemaPath, base_url: Optional[str] = None):
...
def check_spec(self, spec: SchemaPath) -> None:
...
def unmarshal(
self,
request: WebhookRequest,
) -> RequestUnmarshalResult:
...