summaryrefslogtreecommitdiff
path: root/venv/lib/python3.11/site-packages/litestar/openapi/spec/path_item.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/path_item.py
parent4f884c9abc32990b4061a1bb6997b4b37e58ea0b (diff)
venv
Diffstat (limited to 'venv/lib/python3.11/site-packages/litestar/openapi/spec/path_item.py')
-rw-r--r--venv/lib/python3.11/site-packages/litestar/openapi/spec/path_item.py78
1 files changed, 78 insertions, 0 deletions
diff --git a/venv/lib/python3.11/site-packages/litestar/openapi/spec/path_item.py b/venv/lib/python3.11/site-packages/litestar/openapi/spec/path_item.py
new file mode 100644
index 0000000..17005c5
--- /dev/null
+++ b/venv/lib/python3.11/site-packages/litestar/openapi/spec/path_item.py
@@ -0,0 +1,78 @@
+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.operation import Operation
+ from litestar.openapi.spec.parameter import Parameter
+ from litestar.openapi.spec.reference import Reference
+ from litestar.openapi.spec.server import Server
+
+__all__ = ("PathItem",)
+
+
+@dataclass
+class PathItem(BaseSchemaObject):
+ """Describes the operations available on a single path.
+
+ A Path Item MAY be empty, due to `ACL constraints <https://spec.openapis.org/oas/v3.1.0#securityFiltering>`_. The
+ path itself is still exposed to the documentation viewer, but they will not know which operations and parameters are
+ available.
+ """
+
+ ref: str | None = None
+ """Allows for an external definition of this path item. The referenced structure MUST be in the format of a
+ `Path Item Object <https://spec.openapis.org/oas/v3.1.0#pathItemObject>`.
+
+ In case a Path Item Object field appears both in the defined object and the referenced object, the behavior is
+ undefined. See the rules for resolving
+ `Relative References <https://spec.openapis.org/oas/v3.1.0#relativeReferencesURI>`_.
+ """
+
+ summary: str | None = None
+ """An optional, string summary, intended to apply to all operations in this path."""
+
+ description: str | None = None
+ """An optional, string description, intended to apply to all operations in this path.
+
+ `CommonMark syntax <https://spec.commonmark.org/>`_ MAY be used for rich text representation.
+ """
+
+ get: Operation | None = None
+ """A definition of a GET operation on this path."""
+
+ put: Operation | None = None
+ """A definition of a PUT operation on this path."""
+
+ post: Operation | None = None
+ """A definition of a POST operation on this path."""
+
+ delete: Operation | None = None
+ """A definition of a DELETE operation on this path."""
+
+ options: Operation | None = None
+ """A definition of a OPTIONS operation on this path."""
+
+ head: Operation | None = None
+ """A definition of a HEAD operation on this path."""
+
+ patch: Operation | None = None
+ """A definition of a PATCH operation on this path."""
+
+ trace: Operation | None = None
+ """A definition of a TRACE operation on this path."""
+
+ servers: list[Server] | None = None
+ """An alternative ``server`` array to service all operations in this path."""
+
+ parameters: list[Parameter | Reference] | None = None
+ """A list of parameters that are applicable for all the operations described under this path. These parameters can
+ be overridden at the operation level, but cannot be removed there. The list MUST NOT include duplicated parameters.
+ A unique parameter is defined by a combination of a `name <https://spec.openapis.org/oas/v3.1.0#parameterName>`_ and
+ `location <https://spec.openapis.org/oas/v3.1.0#parameterIn>`_. The list can use the
+ `Reference Object <https://spec.openapis.org/oas/v3.1.0#referenceObject>`_ to link to parameters that are defined at
+ the `OpenAPI Object's components/parameters <https://spec.openapis.org/oas/v3.1.0#componentsParameters>`_.
+ """