1
0
Fork 0
openapi-pydantic/openapi_pydantic/v3/v3_0
Daniel Baumann 97e6d74bac
Adding upstream version 0.5.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
2025-05-04 22:22:32 +02:00
..
__init__.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
callback.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
components.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
contact.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
datatype.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
discriminator.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
encoding.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
example.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
external_documentation.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
header.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
info.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
license.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
link.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
media_type.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
oauth_flow.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
oauth_flows.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
open_api.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
operation.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
parameter.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
path_item.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
paths.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
README.md Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
reference.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
request_body.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
response.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
responses.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
schema.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
security_requirement.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
security_scheme.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
server.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
server_variable.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
tag.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
util.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00
xml.py Adding upstream version 0.5.1. 2025-05-04 22:22:32 +02:00

OpenAPI v3.0 schema classes

Alias

Due to the reserved words in python and pydantic, the following fields are used with alias feature provided by pydantic:

Class Field name in the class Alias (as in OpenAPI spec)
Header* param_in in
MediaType media_type_schema schema
Parameter param_in in
Parameter param_schema schema
PathItem ref $ref
Reference ref $ref
SecurityScheme security_scheme_in in
Schema schema_format format
Schema schema_not not

The "in" field in Header object is actually a constant ({"in": "header"}).

For convenience of object creation, the classes mentioned in above have configured allow_population_by_field_name=True (Pydantic V1) or populate_by_name=True (Pydantic V2).

Reference: Pydantic's Model Config

Non-pydantic schema types

Due to the constriants of python typing structure (not able to handle dynamic field names), the following schema classes are actually just a typing of Dict:

Schema Type Implementation
Callback Callback = Dict[str, PathItem]
Paths Paths = Dict[str, PathItem]
Responses Responses = Dict[str, Union[Response, Reference]]
SecurityRequirement SecurityRequirement = Dict[str, List[str]]

On creating such schema instances, please use python's dict type instead to instantiate.