summaryrefslogtreecommitdiff
path: root/venv/lib/python3.11/site-packages/litestar/openapi/datastructures.py
blob: 5796a48d4c472d8c3194f679e5d3f988d3d71e7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from __future__ import annotations

from dataclasses import dataclass, field
from typing import TYPE_CHECKING

from litestar.enums import MediaType

if TYPE_CHECKING:
    from litestar.openapi.spec import Example
    from litestar.types import DataContainerType


__all__ = ("ResponseSpec",)


@dataclass
class ResponseSpec:
    """Container type of additional responses."""

    data_container: DataContainerType | None
    """A model that describes the content of the response."""
    generate_examples: bool = field(default=True)
    """Generate examples for the response content."""
    description: str = field(default="Additional response")
    """A description of the response."""
    media_type: MediaType = field(default=MediaType.JSON)
    """Response media type."""
    examples: list[Example] | None = field(default=None)
    """A list of Example models."""