amati 0.2.23__tar.gz → 0.2.25__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.
Files changed (95) hide show
  1. {amati-0.2.23 → amati-0.2.25}/PKG-INFO +1 -1
  2. {amati-0.2.23 → amati-0.2.25}/amati/_data/files/media-types.json +5 -0
  3. {amati-0.2.23 → amati-0.2.25}/amati/model_validators.py +3 -1
  4. {amati-0.2.23 → amati-0.2.25}/amati/validators/oas304.py +21 -23
  5. {amati-0.2.23 → amati-0.2.25}/amati/validators/oas311.py +13 -11
  6. {amati-0.2.23 → amati-0.2.25}/pyproject.toml +1 -1
  7. {amati-0.2.23 → amati-0.2.25}/tests/data/.amati.tests.yaml +13 -1
  8. {amati-0.2.23 → amati-0.2.25}/uv.lock +1 -1
  9. {amati-0.2.23 → amati-0.2.25}/.dockerignore +0 -0
  10. {amati-0.2.23 → amati-0.2.25}/.github/dependabot.yml +0 -0
  11. {amati-0.2.23 → amati-0.2.25}/.github/workflows/checks.yaml +0 -0
  12. {amati-0.2.23 → amati-0.2.25}/.github/workflows/codeql.yml +0 -0
  13. {amati-0.2.23 → amati-0.2.25}/.github/workflows/coverage.yaml +0 -0
  14. {amati-0.2.23 → amati-0.2.25}/.github/workflows/data-refresh.yaml +0 -0
  15. {amati-0.2.23 → amati-0.2.25}/.github/workflows/dependency-review.yml +0 -0
  16. {amati-0.2.23 → amati-0.2.25}/.github/workflows/publish.yaml +0 -0
  17. {amati-0.2.23 → amati-0.2.25}/.github/workflows/scorecards.yml +0 -0
  18. {amati-0.2.23 → amati-0.2.25}/.github/workflows/tag-and-create-release.yaml +0 -0
  19. {amati-0.2.23 → amati-0.2.25}/.gitignore +0 -0
  20. {amati-0.2.23 → amati-0.2.25}/.pre-commit-config.yaml +0 -0
  21. {amati-0.2.23 → amati-0.2.25}/.python-version +0 -0
  22. {amati-0.2.23 → amati-0.2.25}/Dockerfile +0 -0
  23. {amati-0.2.23 → amati-0.2.25}/LICENSE +0 -0
  24. {amati-0.2.23 → amati-0.2.25}/README.md +0 -0
  25. {amati-0.2.23 → amati-0.2.25}/SECURITY.md +0 -0
  26. {amati-0.2.23 → amati-0.2.25}/TEMPLATE.html +0 -0
  27. {amati-0.2.23 → amati-0.2.25}/amati/__init__.py +0 -0
  28. {amati-0.2.23 → amati-0.2.25}/amati/_data/files/http-status-codes.json +0 -0
  29. {amati-0.2.23 → amati-0.2.25}/amati/_data/files/iso9110.json +0 -0
  30. {amati-0.2.23 → amati-0.2.25}/amati/_data/files/schemes.json +0 -0
  31. {amati-0.2.23 → amati-0.2.25}/amati/_data/files/spdx-licences.json +0 -0
  32. {amati-0.2.23 → amati-0.2.25}/amati/_data/files/tlds.json +0 -0
  33. {amati-0.2.23 → amati-0.2.25}/amati/_data/http_status_code.py +0 -0
  34. {amati-0.2.23 → amati-0.2.25}/amati/_data/iso9110.py +0 -0
  35. {amati-0.2.23 → amati-0.2.25}/amati/_data/media_types.py +0 -0
  36. {amati-0.2.23 → amati-0.2.25}/amati/_data/refresh.py +0 -0
  37. {amati-0.2.23 → amati-0.2.25}/amati/_data/schemes.py +0 -0
  38. {amati-0.2.23 → amati-0.2.25}/amati/_data/spdx_licences.py +0 -0
  39. {amati-0.2.23 → amati-0.2.25}/amati/_data/tlds.py +0 -0
  40. {amati-0.2.23 → amati-0.2.25}/amati/_error_handler.py +0 -0
  41. {amati-0.2.23 → amati-0.2.25}/amati/_logging.py +0 -0
  42. {amati-0.2.23 → amati-0.2.25}/amati/_resolve_forward_references.py +0 -0
  43. {amati-0.2.23 → amati-0.2.25}/amati/amati.py +0 -0
  44. {amati-0.2.23 → amati-0.2.25}/amati/exceptions.py +0 -0
  45. {amati-0.2.23 → amati-0.2.25}/amati/fields/__init__.py +0 -0
  46. {amati-0.2.23 → amati-0.2.25}/amati/fields/_custom_types.py +0 -0
  47. {amati-0.2.23 → amati-0.2.25}/amati/fields/commonmark.py +0 -0
  48. {amati-0.2.23 → amati-0.2.25}/amati/fields/email.py +0 -0
  49. {amati-0.2.23 → amati-0.2.25}/amati/fields/http_status_codes.py +0 -0
  50. {amati-0.2.23 → amati-0.2.25}/amati/fields/iso9110.py +0 -0
  51. {amati-0.2.23 → amati-0.2.25}/amati/fields/json.py +0 -0
  52. {amati-0.2.23 → amati-0.2.25}/amati/fields/media.py +0 -0
  53. {amati-0.2.23 → amati-0.2.25}/amati/fields/oas.py +0 -0
  54. {amati-0.2.23 → amati-0.2.25}/amati/fields/spdx_licences.py +0 -0
  55. {amati-0.2.23 → amati-0.2.25}/amati/fields/uri.py +0 -0
  56. {amati-0.2.23 → amati-0.2.25}/amati/file_handler.py +0 -0
  57. {amati-0.2.23 → amati-0.2.25}/amati/grammars/oas.py +0 -0
  58. {amati-0.2.23 → amati-0.2.25}/amati/grammars/rfc6901.py +0 -0
  59. {amati-0.2.23 → amati-0.2.25}/amati/grammars/rfc7159.py +0 -0
  60. {amati-0.2.23 → amati-0.2.25}/amati/py.typed +0 -0
  61. {amati-0.2.23 → amati-0.2.25}/amati/validators/__init__.py +0 -0
  62. {amati-0.2.23 → amati-0.2.25}/amati/validators/generic.py +0 -0
  63. {amati-0.2.23 → amati-0.2.25}/bin/checks.sh +0 -0
  64. {amati-0.2.23 → amati-0.2.25}/bin/startup.sh +0 -0
  65. {amati-0.2.23 → amati-0.2.25}/bin/upgrade-python.sh +0 -0
  66. {amati-0.2.23 → amati-0.2.25}/bin/uv-upgrade-from-main.sh +0 -0
  67. {amati-0.2.23 → amati-0.2.25}/scripts/setup_test_specs.py +0 -0
  68. {amati-0.2.23 → amati-0.2.25}/tests/__init__.py +0 -0
  69. {amati-0.2.23 → amati-0.2.25}/tests/data/DigitalOcean-public.v2.errors.json +0 -0
  70. {amati-0.2.23 → amati-0.2.25}/tests/data/api.github.com.yaml.errors.json +0 -0
  71. {amati-0.2.23 → amati-0.2.25}/tests/data/next-api.github.com.yaml.errors.json +0 -0
  72. {amati-0.2.23 → amati-0.2.25}/tests/data/openapi.yaml +0 -0
  73. {amati-0.2.23 → amati-0.2.25}/tests/data/openapi.yaml.gz +0 -0
  74. {amati-0.2.23 → amati-0.2.25}/tests/data/redocly.openapi.yaml.errors.json +0 -0
  75. {amati-0.2.23 → amati-0.2.25}/tests/fields/__init__.py +0 -0
  76. {amati-0.2.23 → amati-0.2.25}/tests/fields/test_email.py +0 -0
  77. {amati-0.2.23 → amati-0.2.25}/tests/fields/test_http_status_codes.py +0 -0
  78. {amati-0.2.23 → amati-0.2.25}/tests/fields/test_iso9110.py +0 -0
  79. {amati-0.2.23 → amati-0.2.25}/tests/fields/test_media.py +0 -0
  80. {amati-0.2.23 → amati-0.2.25}/tests/fields/test_oas.py +0 -0
  81. {amati-0.2.23 → amati-0.2.25}/tests/fields/test_spdx_licences.py +0 -0
  82. {amati-0.2.23 → amati-0.2.25}/tests/fields/test_uri.py +0 -0
  83. {amati-0.2.23 → amati-0.2.25}/tests/helpers.py +0 -0
  84. {amati-0.2.23 → amati-0.2.25}/tests/model_validators/test_all_of.py +0 -0
  85. {amati-0.2.23 → amati-0.2.25}/tests/model_validators/test_at_least_one.py +0 -0
  86. {amati-0.2.23 → amati-0.2.25}/tests/model_validators/test_if_then.py +0 -0
  87. {amati-0.2.23 → amati-0.2.25}/tests/model_validators/test_only_one.py +0 -0
  88. {amati-0.2.23 → amati-0.2.25}/tests/test_amati.py +0 -0
  89. {amati-0.2.23 → amati-0.2.25}/tests/test_external_specs.py +0 -0
  90. {amati-0.2.23 → amati-0.2.25}/tests/test_logging.py +0 -0
  91. {amati-0.2.23 → amati-0.2.25}/tests/validators/__init__.py +0 -0
  92. {amati-0.2.23 → amati-0.2.25}/tests/validators/test_generic.py +0 -0
  93. {amati-0.2.23 → amati-0.2.25}/tests/validators/test_licence_object.py +0 -0
  94. {amati-0.2.23 → amati-0.2.25}/tests/validators/test_security_scheme_object.py +0 -0
  95. {amati-0.2.23 → amati-0.2.25}/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.23
3
+ Version: 0.2.25
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
@@ -665,6 +665,10 @@
665
665
  "vnd.aristanetworks.swi",
666
666
  "vnd.artisan+json",
667
667
  "vnd.artsquare",
668
+ "vnd.as207960.vas.config+jer",
669
+ "vnd.as207960.vas.config+uper",
670
+ "vnd.as207960.vas.tap+jer",
671
+ "vnd.as207960.vas.tap+uper",
668
672
  "vnd.astraea-software.iota",
669
673
  "vnd.audiograph",
670
674
  "vnd.autopackage",
@@ -1068,6 +1072,7 @@
1068
1072
  "vnd.lotus-screencam",
1069
1073
  "vnd.lotus-wordpro",
1070
1074
  "vnd.macports.portpkg",
1075
+ "vnd.maml",
1071
1076
  "vnd.mapbox-vector-tile",
1072
1077
  "vnd.marlin.drm.actiontoken+xml",
1073
1078
  "vnd.marlin.drm.conftoken+xml",
@@ -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) -> "UnknownValue":
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, Optional, Self
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["ParameterObject | ReferenceObject"] | None = None
262
- requestBody: Optional["RequestBodyObject | ReferenceObject"] = None
263
- responses: "ResponsesObject"
264
- callbacks: dict[str, "CallbackObject | ReferenceObject"] | None = None
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["SecurityRequirementObject"] | None = None
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_: Optional["SchemaObject | ReferenceObject"] = Field(alias="schema")
300
+ schema_: SchemaObject | ReferenceObject | None = Field(alias="schema")
299
301
  example: Any | None = None
300
- examples: dict[str, "ExampleObject | ReferenceObject"] | None = None
301
- content: dict[str, "MediaTypeObject"] | None = None
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, "MediaTypeObject"]
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_: Optional["SchemaObject | ReferenceObject"] = Field(
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: Optional["EncodingObject"] = None
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, "HeaderObject | ReferenceObject"] | None = None
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: Optional["ResponseObject | ReferenceObject"] = None
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
- ) -> "ReferenceObject | ResponseObject":
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, "HeaderObject | ReferenceObject"] | None = None
489
+ headers: dict[str, HeaderObject | ReferenceObject] | None = None
490
490
  content: dict[str, MediaTypeObject] | None = None
491
- links: dict[str, "LinkObject | ReferenceObject"] | None = None
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, "PathItemObject"]:
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_: Optional["SchemaObject | ReferenceObject"] = Field(
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, Optional, Self
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["ParameterObject | ReferenceObject"] | None = None
239
- requestBody: Optional["RequestBodyObject | ReferenceObject"] = None
240
- responses: Optional["ResponsesObject"] = None
241
- callbacks: dict[str, "CallbackObject | ReferenceObject"] | None = None
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["SecurityRequirementObject"] | None = None
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_: Optional["SchemaObject"] = Field(alias="schema")
277
+ schema_: SchemaObject | None = Field(alias="schema")
276
278
  example: Any | None = None
277
- examples: dict[str, "ExampleObject | ReferenceObject"] | None = None
278
- content: dict[str, "MediaTypeObject"] | None = None
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_: Optional["SchemaObject"] = Field(alias="schema", default=None)
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: Optional["EncodingObject"] = None
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
  )
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "amati"
3
- version = "0.2.23"
3
+ version = "0.2.25"
4
4
  description = "Validates that a .yaml or .json file conforms to the OpenAPI Specifications 3.x."
5
5
  readme = "README.md"
6
6
  authors = [
@@ -83,4 +83,16 @@ repos:
83
83
  error_file:
84
84
  licence: MIT
85
85
  licence:permalink: https://www.openbanking.org.uk/open-licence/
86
- spec: dist/openapi/vrp-openapi.json
86
+ spec: dist/openapi/vrp-openapi.json
87
+ discourse:
88
+ uri: https://github.com/discourse/discourse_api_docs.git
89
+ revision: 11ac69848bdfa50b39ca037361feef87701efe57
90
+ licence: MIT
91
+ licence_permalink: https://github.com/discourse/discourse_api_docs/blob/11ac69848bdfa50b39ca037361feef87701efe57/LICENSE.txt
92
+ spec: openapi.yml
93
+ elasticsearch:
94
+ uri: https://github.com/elastic/elasticsearch-specification.git
95
+ revision: 88ed8664f1c6662d0a277627092255bde3259c5c
96
+ licence: Apache 2.0
97
+ licence_permalink: https://github.com/elastic/elasticsearch-specification/blob/88ed8664f1c6662d0a277627092255bde3259c5c/LICENSE
98
+ spec: output/openapi/elasticsearch-openapi.json
@@ -13,7 +13,7 @@ wheels = [
13
13
 
14
14
  [[package]]
15
15
  name = "amati"
16
- version = "0.2.23"
16
+ version = "0.2.25"
17
17
  source = { editable = "." }
18
18
  dependencies = [
19
19
  { name = "abnf" },
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