ft3.api.obj module¶
Api objects module.
- class Api(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ComponentOpenAPI OpenAPI Object.
- servers: Field[list[ServerObject] | None]¶
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('_ref_', 'components', 'info', 'openapi', 'paths', 'servers', 'tags')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ()¶
- class_as_dict: lib.t.Final[lib.t.Optional[dict[typ.AnyString, lib.t.Any]]] = {}¶
Instantiate class directly from passed
dict(assumed to be version of class indictform).
- classmethod register(obj_: type[ObjectType]) type[ObjectType]¶
Register an
Objectto be served from the API.
- class Component(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ObjectOpenAPI Component.
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('_ref_',)¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ()¶
- class_as_dict: lib.t.Final[lib.t.Optional[dict[typ.AnyString, lib.t.Any]]] = {}¶
Instantiate class directly from passed
dict(assumed to be version of class indictform).
- class Content(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ComponentOpenAPI content for ContentType.
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('_ref_', 'schema')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ()¶
- class_as_dict: lib.t.Final[lib.t.Optional[dict[typ.AnyString, lib.t.Any]]] = {}¶
Instantiate class directly from passed
dict(assumed to be version of class indictform).
- class File(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ObjectA file object, useful for serving static files.
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('content', 'content_type', 'path')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ()¶
- class_as_dict: lib.t.Final[lib.t.Optional[dict[typ.AnyString, lib.t.Any]]] = {}¶
Instantiate class directly from passed
dict(assumed to be version of class indictform).
- class Header(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ComponentOpenAPI Header Object.
- classmethod request(name: str, description: str | None, *methods: str) Callable[[type[ObjectType]], type[ObjectType]]¶
Register a request header for
Object.
- classmethod response(name: str, description: str | None, *methods: str) Callable[[type[ObjectType]], type[ObjectType]]¶
Register a response header for
Object.
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('_ref_', 'description', 'schema')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ()¶
- class_as_dict: lib.t.Final[lib.t.Optional[dict[typ.AnyString, lib.t.Any]]] = {}¶
Instantiate class directly from passed
dict(assumed to be version of class indictform).
- class Healthz(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ObjectDefault application heartbeat.
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('status',)¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ()¶
- class_as_dict: lib.t.Final[lib.t.Optional[dict[typ.AnyString, lib.t.Any]]] = {}¶
Instantiate class directly from passed
dict(assumed to be version of class indictform).
- class Info(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ComponentOpenAPI Info Object.
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('_ref_', 'description', 'summary', 'terms_of_service', 'title', 'version')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ()¶
- class_as_dict: lib.t.Final[lib.t.Optional[dict[typ.AnyString, lib.t.Any]]] = {}¶
Instantiate class directly from passed
dict(assumed to be version of class indictform).
- class Operation(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ComponentOpenAPI Operation Object.
- request_body: Field[RequestBody | None]¶
- responses: Field[dict[str, ResponseObject] | None]¶
- property path_uri: str¶
Path URI.
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('_ref_', 'description', 'parameters', 'request_body', 'responses', 'security', 'summary', 'tags')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ()¶
- class_as_dict: lib.t.Final[lib.t.Optional[dict[typ.AnyString, lib.t.Any]]] = {}¶
Instantiate class directly from passed
dict(assumed to be version of class indictform).
- class Parameter(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ComponentOpenAPI Parameter Object.
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {'in_': ('path', 'query', 'header', 'cookie')}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('_ref_', 'deprecated', 'description', 'in_', 'name', 'required', 'schema')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ('name',)¶
- class_as_dict: lib.t.Final[lib.t.Optional[dict[typ.AnyString, lib.t.Any]]] = {}¶
Instantiate class directly from passed
dict(assumed to be version of class indictform).
- class Path(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ComponentOpenAPI Path Item Object.
- update_options(cls: type[Object], include_default_response_headers: bool) None¶
Update options operation for the endpoint.
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('_ref_', '_resource_', 'delete', 'description', 'get_', 'options', 'patch', 'post', 'put', 'summary')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ()¶
- class_as_dict: lib.t.Final[lib.t.Optional[dict[typ.AnyString, lib.t.Any]]] = {}¶
Instantiate class directly from passed
dict(assumed to be version of class indictform).
- class RequestBody(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ComponentOpenAPI Request Body Object.
- content: Field[dict[Literal['*/*', 'text/html', 'image/x-icon', 'application/json', 'image/png', 'text/plain'], Content]]¶
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('_ref_', 'content', 'description')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ()¶
- class_as_dict: lib.t.Final[lib.t.Optional[dict[typ.AnyString, lib.t.Any]]] = {}¶
Instantiate class directly from passed
dict(assumed to be version of class indictform).
- class ResponseObject(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ComponentOpenAPI Request Body Object.
- content: Field[dict[Literal['*/*', 'text/html', 'image/x-icon', 'application/json', 'image/png', 'text/plain'], Content | None]]¶
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('_ref_', 'content', 'description', 'headers')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ()¶
- class_as_dict: lib.t.Final[lib.t.Optional[dict[typ.AnyString, lib.t.Any]]] = {}¶
Instantiate class directly from passed
dict(assumed to be version of class indictform).
- class Schema(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ComponentOpenAPI Schema Object.
- type_: Field[list[Literal['array', 'boolean', 'integer', 'null', 'number', 'object', 'string']] | None]¶
- format_: Field[Literal['boolean'] | Literal['byte'] | Literal['date'] | Literal['datetime'] | Literal['double'] | Literal['float'] | Literal['int32'] | Literal['uuid'] | None]¶
- classmethod from_obj(obj: type[Object], /, **kwargs: Any) Schema¶
Parse Schema definition from
Object.
- classmethod from_type(*, type_: Any = None, **kwargs: Any) Schema¶
Parse Schema definition from python
type.
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {'format_': ('boolean', 'byte', 'date', 'datetime', 'double', 'float', 'int32', 'uuid', None), 'type_': ('array', 'boolean', 'integer', 'null', 'number', 'object', 'string', None)}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('_ref_', 'all_of', 'any_of', 'default', 'description', 'enum', 'exclusive_maximum', 'exclusive_minimum', 'format_', 'items_', 'max_items', 'max_length', 'maximum', 'min_items', 'min_length', 'minimum', 'multiple_of', 'one_of', 'pattern', 'properties', 'read_only', 'required', 'type_', 'unique_items', 'write_only')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ()¶
- class_as_dict: lib.t.Final[lib.t.Optional[dict[typ.AnyString, lib.t.Any]]] = {}¶
Instantiate class directly from passed
dict(assumed to be version of class indictform).
- class SecurityScheme(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ComponentOpenAPI Security Scheme Object.
- content: Field[dict[Literal['*/*', 'text/html', 'image/x-icon', 'application/json', 'image/png', 'text/plain'], Content]]¶
- classmethod api_key(name: str, description: str | None, *methods: str) Callable[[type[ObjectType]], type[ObjectType]]¶
Register API Key
SecuritySchemeforObject.
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {'in_': ('header', 'query', 'cookie', None), 'scheme': ('basic', 'bearer', None), 'type_': ('http', 'apiKey', 'oauth2', 'openIdConnect')}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('_ref_', 'content', 'description', 'in_', 'name_', 'scheme', 'type_')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ('name_',)¶
- class_as_dict: lib.t.Final[lib.t.Optional[dict[typ.AnyString, lib.t.Any]]] = {}¶
Instantiate class directly from passed
dict(assumed to be version of class indictform).
- class ServerObject(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ComponentOpenAPI Server Object.
- variables: Field[dict[str, ServerVariable] | None]¶
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('_ref_', 'description', 'url', 'variables')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ()¶
- class_as_dict: lib.t.Final[lib.t.Optional[dict[typ.AnyString, lib.t.Any]]] = {}¶
Instantiate class directly from passed
dict(assumed to be version of class indictform).
- class ServerVariable(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ComponentOpenAPI Server Variable Object.
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('_ref_', 'default', 'description')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ()¶
- class_as_dict: lib.t.Final[lib.t.Optional[dict[typ.AnyString, lib.t.Any]]] = {}¶
Instantiate class directly from passed
dict(assumed to be version of class indictform).
- class Tag(class_as_dict: dict[str | string[StringType], Any] | None = None, /, **kwargs: Any)¶
Bases:
ComponentOpenAPI Tag Object.
- enumerations: lib.t.ClassVar[dict[str, tuple[typ.Primitive, ...]]] = {}¶
- fields: lib.t.ClassVar[typ.FieldsTuple] = ('_ref_', 'description', 'name')¶
- hash_fields: lib.t.ClassVar[typ.FieldsTuple] = ('name',)¶
- class_as_dict: lib.t.Final[lib.t.Optional[dict[typ.AnyString, lib.t.Any]]] = {}¶
Instantiate class directly from passed
dict(assumed to be version of class indictform).
- DEFAULT_RESPONSE_HEADERS¶
Default response headers.
- REQUEST_HEADERS: dict[str, dict[str, list[Parameter]]] = {}¶
All request
Headersregistered to the API.
- RESPONSE_HEADERS: dict[str, dict[str, dict[str, Header]]] = {}¶
All response
Headersregistered to the API.
- OBJECTS: dict[str, type[typ.Object]] = {}¶
All
Objectsserved by the API.
- SECURITY: dict[str, dict[str, list[SecurityScheme]]] = {}¶
All
SecuritySchemesregistered to the API.