summaryrefslogtreecommitdiff
path: root/venv/lib/python3.11/site-packages/litestar/openapi/spec/server.py
diff options
context:
space:
mode:
Diffstat (limited to 'venv/lib/python3.11/site-packages/litestar/openapi/spec/server.py')
-rw-r--r--venv/lib/python3.11/site-packages/litestar/openapi/spec/server.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/venv/lib/python3.11/site-packages/litestar/openapi/spec/server.py b/venv/lib/python3.11/site-packages/litestar/openapi/spec/server.py
new file mode 100644
index 0000000..2c12fcf
--- /dev/null
+++ b/venv/lib/python3.11/site-packages/litestar/openapi/spec/server.py
@@ -0,0 +1,34 @@
+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.server_variable import ServerVariable
+
+__all__ = ("Server",)
+
+
+@dataclass
+class Server(BaseSchemaObject):
+ """An object representing a Server."""
+
+ url: str
+ """
+ **REQUIRED**. A URL to the target host.
+
+ This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the
+ location where the OpenAPI document is being served. Variable substitutions will be made when a variable is named in
+ ``{brackets}``.
+ """
+
+ description: str | None = None
+ """An optional string describing the host designated by the URL.
+
+ `CommonMark syntax <https://spec.commonmark.org/>`_ MAY be used for rich text representation.
+ """
+
+ variables: dict[str, ServerVariable] | None = None
+ """A map between a variable name and its value. The value is used for substitution in the server's URL template."""