summaryrefslogtreecommitdiff
path: root/venv/lib/python3.11/site-packages/litestar/openapi/spec/example.py
diff options
context:
space:
mode:
Diffstat (limited to 'venv/lib/python3.11/site-packages/litestar/openapi/spec/example.py')
-rw-r--r--venv/lib/python3.11/site-packages/litestar/openapi/spec/example.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/venv/lib/python3.11/site-packages/litestar/openapi/spec/example.py b/venv/lib/python3.11/site-packages/litestar/openapi/spec/example.py
new file mode 100644
index 0000000..414452e
--- /dev/null
+++ b/venv/lib/python3.11/site-packages/litestar/openapi/spec/example.py
@@ -0,0 +1,33 @@
+from __future__ import annotations
+
+from dataclasses import dataclass
+from typing import Any
+
+from litestar.openapi.spec.base import BaseSchemaObject
+
+
+@dataclass
+class Example(BaseSchemaObject):
+ summary: str | None = None
+ """Short description for the example."""
+
+ description: str | None = None
+ """Long description for the example.
+
+ `CommonMark syntax <https://spec.commonmark.org/>`_ MAY be used for rich text representation.
+ """
+
+ value: Any | None = None
+ """Embedded literal example.
+
+ The ``value`` field and ``externalValue`` field are mutually exclusive. To represent examples of media types that
+ cannot naturally represented in JSON or YAML, use a string value to contain the example, escaping where necessary.
+ """
+
+ external_value: str | None = None
+ """A URL that points to the literal example. This provides the capability to reference examples that cannot easily
+ be included in JSON or YAML documents.
+
+ The ``value`` field and ``externalValue`` field are mutually exclusive. See the rules for resolving
+ `Relative References <https://spec.openapis.org/oas/v3.1.0#relativeReferencesURI>`_.
+ """