Response
This class represents a single response from an API operation, including its description and associated metadata. It provides structured fields for defining response headers, content media types, and links to other operations.
Attributes
| Attribute | Type | Description |
|---|---|---|
| description | str | A short description of the response, which may contain CommonMark syntax for rich text formatting. |
| headers | `dict[str, Header | Reference] |
| content | `dict[str, MediaType] | None` = None |
| links | `dict[str, Link | Reference] |
Constructor
Signature
def Response(
description: str,
headers: dict[str, Header | Reference]| None = None,
content: dict[str, [MediaType](mediatype.md?sid=fastapi_openapi_models_mediatype)]| None = None,
links: dict[str, Link | Reference]| None = None
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| description | str | A short description of the response. |
| headers | `dict[str, Header | Reference] |
| content | `dict[str, MediaType] | None` = None |
| links | `dict[str, Link | Reference] |
Signature
def Response(
description: string,
headers: dict[str, Header | Reference]| None = None,
content: dict[str, [MediaType](mediatype.md?sid=fastapi_openapi_models_mediatype)]| None = None,
links: dict[str, Link | Reference]| None = None
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| description | string | A short description of the response, which may include CommonMark syntax for rich text representation. |
| headers | `dict[str, Header | Reference] |
| content | `dict[str, MediaType] | None` = None |
| links | `dict[str, Link | Reference] |