-
-
Notifications
You must be signed in to change notification settings - Fork 133
/
Copy pathprotocols.py
57 lines (45 loc) · 1.25 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
"""OpenAPI core validation response protocols module"""
from typing import Iterator
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 Response
from openapi_core.protocols import WebhookRequest
@runtime_checkable
class ResponseValidator(Protocol):
def __init__(self, spec: SchemaPath, base_url: Optional[str] = None):
...
def check_spec(self, spec: SchemaPath) -> None:
...
def iter_errors(
self,
request: Request,
response: Response,
) -> Iterator[Exception]:
...
def validate(
self,
request: Request,
response: Response,
) -> None:
...
@runtime_checkable
class WebhookResponseValidator(Protocol):
def __init__(self, spec: SchemaPath, base_url: Optional[str] = None):
...
def check_spec(self, spec: SchemaPath) -> None:
...
def iter_errors(
self,
request: WebhookRequest,
response: Response,
) -> Iterator[Exception]:
...
def validate(
self,
request: WebhookRequest,
response: Response,
) -> None:
...