-
-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathprotocols.py
More file actions
26 lines (20 loc) · 654 Bytes
/
protocols.py
File metadata and controls
26 lines (20 loc) · 654 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
from collections.abc import Iterator
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: str | None = None,
) -> Iterator[OpenAPIValidationError]: ...
def validate(
self,
instance: Schema,
base_uri: str = "",
spec_url: str | None = None,
) -> None: ...