summaryrefslogtreecommitdiff
path: root/venv/lib/python3.11/site-packages/litestar/openapi/spec/response.py
diff options
context:
space:
mode:
authorcyfraeviolae <cyfraeviolae>2024-04-03 03:10:44 -0400
committercyfraeviolae <cyfraeviolae>2024-04-03 03:10:44 -0400
commit6d7ba58f880be618ade07f8ea080fe8c4bf8a896 (patch)
treeb1c931051ffcebd2bd9d61d98d6233ffa289bbce /venv/lib/python3.11/site-packages/litestar/openapi/spec/response.py
parent4f884c9abc32990b4061a1bb6997b4b37e58ea0b (diff)
venv
Diffstat (limited to 'venv/lib/python3.11/site-packages/litestar/openapi/spec/response.py')
-rw-r--r--venv/lib/python3.11/site-packages/litestar/openapi/spec/response.py48
1 files changed, 48 insertions, 0 deletions
diff --git a/venv/lib/python3.11/site-packages/litestar/openapi/spec/response.py b/venv/lib/python3.11/site-packages/litestar/openapi/spec/response.py
new file mode 100644
index 0000000..236bc40
--- /dev/null
+++ b/venv/lib/python3.11/site-packages/litestar/openapi/spec/response.py
@@ -0,0 +1,48 @@
+from __future__ import annotations
+
+from dataclasses import dataclass
+from typing import TYPE_CHECKING
+
+from litestar.openapi.spec.base import BaseSchemaObject
+
+if TYPE_CHECKING:
+ from litestar.openapi.spec.header import OpenAPIHeader
+ from litestar.openapi.spec.link import Link
+ from litestar.openapi.spec.media_type import OpenAPIMediaType
+ from litestar.openapi.spec.reference import Reference
+
+
+__all__ = ("OpenAPIResponse",)
+
+
+@dataclass
+class OpenAPIResponse(BaseSchemaObject):
+ """Describes a single response from an API Operation, including design-time, static ``links`` to operations based on
+ the response.
+ """
+
+ description: str
+ """**REQUIRED**. A short description of the response.
+ `CommonMark syntax <https://spec.commonmark.org/>`_ MAY be used for rich text representation.
+ """
+
+ headers: dict[str, OpenAPIHeader | Reference] | None = None
+ """Maps a header name to its definition.
+ `RFC7230 <https://tools.ietf.org/html/rfc7230#page-22>`_ states header names are case insensitive.
+ If a response header is defined with the name ``Content-Type``, it SHALL be ignored.
+ """
+
+ content: dict[str, OpenAPIMediaType] | None = None
+ """A map containing descriptions of potential response payloads. The key is a media type or
+ `media type range <https://tools.ietf.org/html/rfc7231#appendix-D>`_ and the value describes it.
+
+ For responses that match multiple keys, only the most specific key is applicable. e.g. ``text/plain`` overrides
+ ``text/*``
+ """
+
+ links: dict[str, Link | Reference] | None = None
+ """A map of operations links that can be followed from the response.
+
+ The key of the map is a short name for the link, following the naming constraints of the names for
+ `Component Objects <https://spec.openapis.org/oas/v3.1.0#componentsObject>`_.
+ """