From 6d7ba58f880be618ade07f8ea080fe8c4bf8a896 Mon Sep 17 00:00:00 2001 From: cyfraeviolae Date: Wed, 3 Apr 2024 03:10:44 -0400 Subject: venv --- .../litestar/openapi/spec/components.py | 72 ++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 venv/lib/python3.11/site-packages/litestar/openapi/spec/components.py (limited to 'venv/lib/python3.11/site-packages/litestar/openapi/spec/components.py') diff --git a/venv/lib/python3.11/site-packages/litestar/openapi/spec/components.py b/venv/lib/python3.11/site-packages/litestar/openapi/spec/components.py new file mode 100644 index 0000000..b11da78 --- /dev/null +++ b/venv/lib/python3.11/site-packages/litestar/openapi/spec/components.py @@ -0,0 +1,72 @@ +from __future__ import annotations + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING + +from litestar.openapi.spec.base import BaseSchemaObject + +__all__ = ("Components",) + + +if TYPE_CHECKING: + from litestar.openapi.spec.callback import Callback + from litestar.openapi.spec.example import Example + from litestar.openapi.spec.header import OpenAPIHeader + from litestar.openapi.spec.link import Link + from litestar.openapi.spec.parameter import Parameter + from litestar.openapi.spec.path_item import PathItem + from litestar.openapi.spec.reference import Reference + from litestar.openapi.spec.request_body import RequestBody + from litestar.openapi.spec.response import OpenAPIResponse + from litestar.openapi.spec.schema import Schema + from litestar.openapi.spec.security_scheme import SecurityScheme + + +@dataclass +class Components(BaseSchemaObject): + """Holds a set of reusable objects for different aspects of the OAS. + + All objects defined within the components object will have no effect + on the API unless they are explicitly referenced from properties + outside the components object. + """ + + schemas: dict[str, Schema] = field(default_factory=dict) + """An object to hold reusable + `Schema Objects `_""" + + responses: dict[str, OpenAPIResponse | Reference] | None = None + """An object to hold reusable + `Response Objects `_""" + + parameters: dict[str, Parameter | Reference] | None = None + """An object to hold reusable + `Parameter Objects `_""" + + examples: dict[str, Example | Reference] | None = None + """An object to hold reusable + `Example Objects `_""" + + request_bodies: dict[str, RequestBody | Reference] | None = None + """An object to hold reusable + `Request Body Objects `_""" + + headers: dict[str, OpenAPIHeader | Reference] | None = None + """An object to hold reusable + `Header Objects `_""" + + security_schemes: dict[str, SecurityScheme | Reference] | None = None + """An object to hold reusable + `Security Scheme Objects `_""" + + links: dict[str, Link | Reference] | None = None + """An object to hold reusable + `Link Objects `_""" + + callbacks: dict[str, Callback | Reference] | None = None + """An object to hold reusable + `Callback Objects `_""" + + path_items: dict[str, PathItem | Reference] | None = None + """An object to hold reusable + `Path Item Object `_""" -- cgit v1.2.3