amati 0.2.23__tar.gz → 0.2.24__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {amati-0.2.23 → amati-0.2.24}/PKG-INFO +1 -1
- {amati-0.2.23 → amati-0.2.24}/amati/model_validators.py +3 -1
- {amati-0.2.23 → amati-0.2.24}/amati/validators/oas304.py +21 -23
- {amati-0.2.23 → amati-0.2.24}/amati/validators/oas311.py +13 -11
- {amati-0.2.23 → amati-0.2.24}/pyproject.toml +1 -1
- {amati-0.2.23 → amati-0.2.24}/uv.lock +1 -1
- {amati-0.2.23 → amati-0.2.24}/.dockerignore +0 -0
- {amati-0.2.23 → amati-0.2.24}/.github/dependabot.yml +0 -0
- {amati-0.2.23 → amati-0.2.24}/.github/workflows/checks.yaml +0 -0
- {amati-0.2.23 → amati-0.2.24}/.github/workflows/codeql.yml +0 -0
- {amati-0.2.23 → amati-0.2.24}/.github/workflows/coverage.yaml +0 -0
- {amati-0.2.23 → amati-0.2.24}/.github/workflows/data-refresh.yaml +0 -0
- {amati-0.2.23 → amati-0.2.24}/.github/workflows/dependency-review.yml +0 -0
- {amati-0.2.23 → amati-0.2.24}/.github/workflows/publish.yaml +0 -0
- {amati-0.2.23 → amati-0.2.24}/.github/workflows/scorecards.yml +0 -0
- {amati-0.2.23 → amati-0.2.24}/.github/workflows/tag-and-create-release.yaml +0 -0
- {amati-0.2.23 → amati-0.2.24}/.gitignore +0 -0
- {amati-0.2.23 → amati-0.2.24}/.pre-commit-config.yaml +0 -0
- {amati-0.2.23 → amati-0.2.24}/.python-version +0 -0
- {amati-0.2.23 → amati-0.2.24}/Dockerfile +0 -0
- {amati-0.2.23 → amati-0.2.24}/LICENSE +0 -0
- {amati-0.2.23 → amati-0.2.24}/README.md +0 -0
- {amati-0.2.23 → amati-0.2.24}/SECURITY.md +0 -0
- {amati-0.2.23 → amati-0.2.24}/TEMPLATE.html +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/__init__.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/_data/files/http-status-codes.json +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/_data/files/iso9110.json +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/_data/files/media-types.json +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/_data/files/schemes.json +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/_data/files/spdx-licences.json +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/_data/files/tlds.json +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/_data/http_status_code.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/_data/iso9110.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/_data/media_types.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/_data/refresh.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/_data/schemes.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/_data/spdx_licences.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/_data/tlds.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/_error_handler.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/_logging.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/_resolve_forward_references.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/amati.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/exceptions.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/fields/__init__.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/fields/_custom_types.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/fields/commonmark.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/fields/email.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/fields/http_status_codes.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/fields/iso9110.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/fields/json.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/fields/media.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/fields/oas.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/fields/spdx_licences.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/fields/uri.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/file_handler.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/grammars/oas.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/grammars/rfc6901.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/grammars/rfc7159.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/py.typed +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/validators/__init__.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/amati/validators/generic.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/bin/checks.sh +0 -0
- {amati-0.2.23 → amati-0.2.24}/bin/startup.sh +0 -0
- {amati-0.2.23 → amati-0.2.24}/bin/upgrade-python.sh +0 -0
- {amati-0.2.23 → amati-0.2.24}/bin/uv-upgrade-from-main.sh +0 -0
- {amati-0.2.23 → amati-0.2.24}/scripts/setup_test_specs.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/tests/__init__.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/tests/data/.amati.tests.yaml +0 -0
- {amati-0.2.23 → amati-0.2.24}/tests/data/DigitalOcean-public.v2.errors.json +0 -0
- {amati-0.2.23 → amati-0.2.24}/tests/data/api.github.com.yaml.errors.json +0 -0
- {amati-0.2.23 → amati-0.2.24}/tests/data/next-api.github.com.yaml.errors.json +0 -0
- {amati-0.2.23 → amati-0.2.24}/tests/data/openapi.yaml +0 -0
- {amati-0.2.23 → amati-0.2.24}/tests/data/openapi.yaml.gz +0 -0
- {amati-0.2.23 → amati-0.2.24}/tests/data/redocly.openapi.yaml.errors.json +0 -0
- {amati-0.2.23 → amati-0.2.24}/tests/fields/__init__.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/tests/fields/test_email.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/tests/fields/test_http_status_codes.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/tests/fields/test_iso9110.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/tests/fields/test_media.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/tests/fields/test_oas.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/tests/fields/test_spdx_licences.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/tests/fields/test_uri.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/tests/helpers.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/tests/model_validators/test_all_of.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/tests/model_validators/test_at_least_one.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/tests/model_validators/test_if_then.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/tests/model_validators/test_only_one.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/tests/test_amati.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/tests/test_external_specs.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/tests/test_logging.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/tests/validators/__init__.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/tests/validators/test_generic.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/tests/validators/test_licence_object.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/tests/validators/test_security_scheme_object.py +0 -0
- {amati-0.2.23 → amati-0.2.24}/tests/validators/test_server_variable_object.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: amati
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.24
|
|
4
4
|
Summary: Validates that a .yaml or .json file conforms to the OpenAPI Specifications 3.x.
|
|
5
5
|
Project-URL: Homepage, https://github.com/ben-alexander/amati
|
|
6
6
|
Project-URL: Issues, https://github.com/ben-alexander/amati/issues
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"""Generic factories to add repetitive validators to Pydantic models."""
|
|
2
2
|
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
3
5
|
from collections.abc import Iterable, Sequence
|
|
4
6
|
from numbers import Number
|
|
5
7
|
from typing import Any
|
|
@@ -21,7 +23,7 @@ class UnknownValue:
|
|
|
21
23
|
|
|
22
24
|
_instance = None
|
|
23
25
|
|
|
24
|
-
def __new__(cls) ->
|
|
26
|
+
def __new__(cls) -> UnknownValue:
|
|
25
27
|
if cls._instance is None:
|
|
26
28
|
cls._instance = super().__new__(cls)
|
|
27
29
|
return cls._instance
|
|
@@ -12,8 +12,10 @@ Note that per https://spec.openapis.org/oas/v3.0.4.html#relative-references-in-a
|
|
|
12
12
|
|
|
13
13
|
"""
|
|
14
14
|
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
15
17
|
import re
|
|
16
|
-
from typing import Any, ClassVar,
|
|
18
|
+
from typing import Any, ClassVar, Self
|
|
17
19
|
|
|
18
20
|
from jsonschema.exceptions import ValidationError as JSONVSchemeValidationError
|
|
19
21
|
from jsonschema.protocols import Validator as JSONSchemaValidator
|
|
@@ -258,12 +260,12 @@ class OperationObject(GenericObject):
|
|
|
258
260
|
description: str | CommonMark | None = None
|
|
259
261
|
externalDocs: ExternalDocumentationObject | None = None
|
|
260
262
|
operationId: str | None = None
|
|
261
|
-
parameters: list[
|
|
262
|
-
requestBody:
|
|
263
|
-
responses:
|
|
264
|
-
callbacks: dict[str,
|
|
263
|
+
parameters: list[ParameterObject | ReferenceObject] | None = None
|
|
264
|
+
requestBody: RequestBodyObject | ReferenceObject | None = None
|
|
265
|
+
responses: ResponsesObject
|
|
266
|
+
callbacks: dict[str, CallbackObject | ReferenceObject] | None = None
|
|
265
267
|
deprecated: bool | None = False
|
|
266
|
-
security: list[
|
|
268
|
+
security: list[SecurityRequirementObject] | None = None
|
|
267
269
|
servers: list[ServerObject] | None = None
|
|
268
270
|
|
|
269
271
|
_reference_uri: ClassVar[str] = (
|
|
@@ -295,10 +297,10 @@ class ParameterObject(GenericObject):
|
|
|
295
297
|
style: str | None = None
|
|
296
298
|
explode: bool | None = None
|
|
297
299
|
allowReserved: bool | None = None
|
|
298
|
-
schema_:
|
|
300
|
+
schema_: SchemaObject | ReferenceObject | None = Field(alias="schema")
|
|
299
301
|
example: Any | None = None
|
|
300
|
-
examples: dict[str,
|
|
301
|
-
content: dict[str,
|
|
302
|
+
examples: dict[str, ExampleObject | ReferenceObject] | None = None
|
|
303
|
+
content: dict[str, MediaTypeObject] | None = None
|
|
302
304
|
_reference_uri: ClassVar[str] = (
|
|
303
305
|
"https://spec.openapis.org/oas/v3.0.4.html#parameter-object"
|
|
304
306
|
)
|
|
@@ -343,7 +345,7 @@ class RequestBodyObject(GenericObject):
|
|
|
343
345
|
"""
|
|
344
346
|
|
|
345
347
|
description: CommonMark | str | None = None
|
|
346
|
-
content: dict[str,
|
|
348
|
+
content: dict[str, MediaTypeObject]
|
|
347
349
|
required: bool | None = False
|
|
348
350
|
_reference_uri: ClassVar[str] = (
|
|
349
351
|
"https://spec.openapis.org/oas/v3.0.4.html#request-body-object"
|
|
@@ -356,13 +358,11 @@ class MediaTypeObject(GenericObject):
|
|
|
356
358
|
Validates the OpenAPI Specification media type object - §4.8.14
|
|
357
359
|
"""
|
|
358
360
|
|
|
359
|
-
schema_:
|
|
360
|
-
alias="schema", default=None
|
|
361
|
-
)
|
|
361
|
+
schema_: SchemaObject | ReferenceObject | None = Field(alias="schema", default=None)
|
|
362
362
|
# FIXME: Define example
|
|
363
363
|
example: Any | None = None
|
|
364
364
|
examples: dict[str, ExampleObject | ReferenceObject] | None = None
|
|
365
|
-
encoding:
|
|
365
|
+
encoding: EncodingObject | None = None
|
|
366
366
|
_reference_uri: ClassVar[str] = (
|
|
367
367
|
"https://spec.openapis.org/oas/v3.0.4.html#media-type-object"
|
|
368
368
|
)
|
|
@@ -375,7 +375,7 @@ class EncodingObject(GenericObject):
|
|
|
375
375
|
"""
|
|
376
376
|
|
|
377
377
|
contentType: str | None = None
|
|
378
|
-
headers: dict[str,
|
|
378
|
+
headers: dict[str, HeaderObject | ReferenceObject] | None = None
|
|
379
379
|
_reference_uri: ClassVar[str] = (
|
|
380
380
|
"https://spec.openapis.org/oas/v3.0.4.html#encoding object-object"
|
|
381
381
|
)
|
|
@@ -409,7 +409,7 @@ class ResponsesObject(GenericObject):
|
|
|
409
409
|
extra="allow",
|
|
410
410
|
)
|
|
411
411
|
|
|
412
|
-
default:
|
|
412
|
+
default: ResponseObject | ReferenceObject | None = None
|
|
413
413
|
_reference_uri: ClassVar[str] = (
|
|
414
414
|
"https://spec.openapis.org/oas/v3.0.4.html#responses-object"
|
|
415
415
|
)
|
|
@@ -417,7 +417,7 @@ class ResponsesObject(GenericObject):
|
|
|
417
417
|
@classmethod
|
|
418
418
|
def _choose_model(
|
|
419
419
|
cls, value: Any, field_name: str
|
|
420
|
-
) ->
|
|
420
|
+
) -> ReferenceObject | ResponseObject:
|
|
421
421
|
"""
|
|
422
422
|
Choose the model to use for validation based on the type of value.
|
|
423
423
|
|
|
@@ -486,9 +486,9 @@ class ResponseObject(GenericObject):
|
|
|
486
486
|
"""
|
|
487
487
|
|
|
488
488
|
description: str | CommonMark
|
|
489
|
-
headers: dict[str,
|
|
489
|
+
headers: dict[str, HeaderObject | ReferenceObject] | None = None
|
|
490
490
|
content: dict[str, MediaTypeObject] | None = None
|
|
491
|
-
links: dict[str,
|
|
491
|
+
links: dict[str, LinkObject | ReferenceObject] | None = None
|
|
492
492
|
_reference_uri: ClassVar[str] = (
|
|
493
493
|
"https://spec.openapis.org/oas/v3.0.4.html#response-object"
|
|
494
494
|
)
|
|
@@ -510,7 +510,7 @@ class CallbackObject(GenericObject):
|
|
|
510
510
|
|
|
511
511
|
@model_validator(mode="before")
|
|
512
512
|
@classmethod
|
|
513
|
-
def validate_all_fields(cls, data: dict[str, Any]) -> dict[str,
|
|
513
|
+
def validate_all_fields(cls, data: dict[str, Any]) -> dict[str, PathItemObject]:
|
|
514
514
|
"""
|
|
515
515
|
Validates the callback object.
|
|
516
516
|
"""
|
|
@@ -605,9 +605,7 @@ class HeaderObject(GenericObject):
|
|
|
605
605
|
# Schema fields
|
|
606
606
|
style: str | None = Field(default="simple")
|
|
607
607
|
explode: bool | None = Field(default=False)
|
|
608
|
-
schema_:
|
|
609
|
-
alias="schema", default=None
|
|
610
|
-
)
|
|
608
|
+
schema_: SchemaObject | ReferenceObject | None = Field(alias="schema", default=None)
|
|
611
609
|
example: JSONValue | None = None
|
|
612
610
|
examples: dict[str, ExampleObject | ReferenceObject] | None = None
|
|
613
611
|
|
|
@@ -12,8 +12,10 @@ Note that per https://spec.openapis.org/oas/v3.1.1.html#relative-references-in-a
|
|
|
12
12
|
|
|
13
13
|
"""
|
|
14
14
|
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
15
17
|
import re
|
|
16
|
-
from typing import Any, ClassVar,
|
|
18
|
+
from typing import Any, ClassVar, Self
|
|
17
19
|
|
|
18
20
|
from jsonschema.exceptions import ValidationError as JSONVSchemeValidationError
|
|
19
21
|
from jsonschema.protocols import Validator as JSONSchemaValidator
|
|
@@ -235,12 +237,12 @@ class OperationObject(GenericObject):
|
|
|
235
237
|
description: str | CommonMark | None = None
|
|
236
238
|
externalDocs: ExternalDocumentationObject | None = None
|
|
237
239
|
operationId: str | None = None
|
|
238
|
-
parameters: list[
|
|
239
|
-
requestBody:
|
|
240
|
-
responses:
|
|
241
|
-
callbacks: dict[str,
|
|
240
|
+
parameters: list[ParameterObject | ReferenceObject] | None = None
|
|
241
|
+
requestBody: RequestBodyObject | ReferenceObject | None = None
|
|
242
|
+
responses: ResponsesObject | None = None
|
|
243
|
+
callbacks: dict[str, CallbackObject | ReferenceObject] | None = None
|
|
242
244
|
deprecated: bool | None = False
|
|
243
|
-
security: list[
|
|
245
|
+
security: list[SecurityRequirementObject] | None = None
|
|
244
246
|
servers: list[ServerObject] | None = None
|
|
245
247
|
|
|
246
248
|
_reference_uri: ClassVar[str] = (
|
|
@@ -272,10 +274,10 @@ class ParameterObject(GenericObject):
|
|
|
272
274
|
style: str | None = None
|
|
273
275
|
explode: bool | None = None
|
|
274
276
|
allowReserved: bool | None = None
|
|
275
|
-
schema_:
|
|
277
|
+
schema_: SchemaObject | None = Field(alias="schema")
|
|
276
278
|
example: Any | None = None
|
|
277
|
-
examples: dict[str,
|
|
278
|
-
content: dict[str,
|
|
279
|
+
examples: dict[str, ExampleObject | ReferenceObject] | None = None
|
|
280
|
+
content: dict[str, MediaTypeObject] | None = None
|
|
279
281
|
_reference_uri: ClassVar[str] = (
|
|
280
282
|
"https://spec.openapis.org/oas/v3.1.1.html#parameter-object"
|
|
281
283
|
)
|
|
@@ -319,11 +321,11 @@ class MediaTypeObject(GenericObject):
|
|
|
319
321
|
Validates the OpenAPI Specification media type object - §4.8.14
|
|
320
322
|
"""
|
|
321
323
|
|
|
322
|
-
schema_:
|
|
324
|
+
schema_: SchemaObject | None = Field(alias="schema", default=None)
|
|
323
325
|
# FIXME: Define example
|
|
324
326
|
example: Any | None = None
|
|
325
327
|
examples: dict[str, ExampleObject | ReferenceObject] | None = None
|
|
326
|
-
encoding:
|
|
328
|
+
encoding: EncodingObject | None = None
|
|
327
329
|
_reference_uri: ClassVar[str] = (
|
|
328
330
|
"https://spec.openapis.org/oas/v3.1.1.html#media-type-object"
|
|
329
331
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|