-
-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathprotocols.py
More file actions
30 lines (24 loc) · 703 Bytes
/
protocols.py
File metadata and controls
30 lines (24 loc) · 703 Bytes
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
from typing import Iterator
from typing import Optional
from typing import Protocol
from typing import runtime_checkable
from jsonschema_path.typing import Schema
from openapi_spec_validator.validation.exceptions import OpenAPIValidationError
@runtime_checkable
class SupportsValidation(Protocol):
def is_valid(self, instance: Schema) -> bool:
...
def iter_errors(
self,
instance: Schema,
base_uri: str = "",
spec_url: Optional[str] = None,
) -> Iterator[OpenAPIValidationError]:
...
def validate(
self,
instance: Schema,
base_uri: str = "",
spec_url: Optional[str] = None,
) -> None:
...