# โก ๐ ๏ธ ๐ง ๐ณ
## ๐ {
!!! warning
๐ฅ ๐ ๐ซ "๐ด" ๐, ๐ ๐ฒ ๐ซ ๐ช ๐.
๐ ๐ช โ ๐ `operationId` โ๏ธ ๐ *โก ๐ ๏ธ* โฎ๏ธ ๐ข `operation_id`.
๐ ๐ โ๏ธ โ ๐ญ ๐ โซ๏ธ ๐ ๐ ๐ ๏ธ.
```Python hl_lines="6"
{!../../../docs_src/path_operation_advanced_configuration/tutorial001.py!}
```
### โ๏ธ *โก ๐ ๏ธ ๐ข* ๐ {
๐ฅ ๐ ๐ โ๏ธ ๐ ๐' ๐ข ๐ `operationId`โ, ๐ ๐ช ๐ ๐คญ ๐ ๐ซ & ๐ ๐ *โก ๐ ๏ธ* `operation_id` โ๏ธ ๐ซ `APIRoute.name`.
๐ ๐ โซ๏ธ โฎ๏ธ โ ๐ ๐ *โก ๐ ๏ธ*.
```Python hl_lines="2 12-21 24"
{!../../../docs_src/path_operation_advanced_configuration/tutorial002.py!}
```
!!! tip
๐ฅ ๐ โ ๐ค `app.openapi()`, ๐ ๐ โน `operationId`โ โญ ๐.
!!! warning
๐ฅ ๐ ๐, ๐ โ๏ธ โ ๐ญ ๐ 1๏ธโฃ ๐ *โก ๐ ๏ธ ๐ข* โ๏ธ ๐ ๐.
๐ฅ ๐ซ ๐ ๐น (๐ ๐).
## ๐ซ โช๏ธโก๏ธ ๐
๐ซ *โก ๐ ๏ธ* โช๏ธโก๏ธ ๐ ๐ ๐ (& โก๏ธ, โช๏ธโก๏ธ ๐ง ๐งพ โ๏ธ), โ๏ธ ๐ข `include_in_schema` & โ โซ๏ธ `False`:
```Python hl_lines="6"
{!../../../docs_src/path_operation_advanced_configuration/tutorial003.py!}
```
## ๐ง ๐ โช๏ธโก๏ธ #๏ธโฃ
๐ ๐ช ๐ โธ โ๏ธ โช๏ธโก๏ธ #๏ธโฃ *โก ๐ ๏ธ ๐ข* ๐.
โ `\f` (๐ "๐จ ๐ผ" ๐ฆน) ๐ค **FastAPI** ๐ ๐ข โ๏ธ ๐ ๐ โ.
โซ๏ธ ๐ ๐ซ ๐ฆ ๐ ๐งพ, โ๏ธ ๐ ๐งฐ (โ
๐) ๐ ๐ช โ๏ธ ๐.
```Python hl_lines="19-29"
{!../../../docs_src/path_operation_advanced_configuration/tutorial004.py!}
```
## ๐ ๐จ
๐ ๐ฒ โ๏ธ ๐ โ ๐ฃ `response_model` & `status_code` *โก ๐ ๏ธ*.
๐ ๐ฌ ๐ ๐ ๐ ๐จ *โก ๐ ๏ธ*.
๐ ๐ช ๐ฃ ๐ ๐จ โฎ๏ธ ๐ซ ๐ท, ๐ ๐, โ๏ธ.
๐ค ๐ ๐ ๐ฅ ๐งพ ๐ โซ๏ธ, ๐ ๐ช โ โซ๏ธ [๐ ๐จ ๐](./additional-responses.md){.internal-link target=_blank}.
## ๐ โ
๐โ ๐ ๐ฃ *โก ๐ ๏ธ* ๐ ๐ธ, **FastAPI** ๐ ๐ ๐ ๐ ๐ ๐ *โก ๐ ๏ธ* ๐ ๐ ๐.
!!! note "๐ก โน"
๐ ๐ง โซ๏ธ ๐ค ๐ ๏ธ ๐.
โซ๏ธ โ๏ธ ๐ โน ๐ *โก ๐ ๏ธ* & โ๏ธ ๐ ๐ง ๐งพ.
โซ๏ธ ๐ `tags`, `parameters`, `requestBody`, `responses`, โ๏ธ.
๐ *โก ๐ ๏ธ*-๐ฏ ๐ ๐ ๐ ๐ ๐ **FastAPI**, โ๏ธ ๐ ๐ช โ โซ๏ธ.
!!! tip
๐ ๐
๐ โ โ.
๐ฅ ๐ ๐ด ๐ช ๐ฃ ๐ ๐จ, ๐
๐ช ๐ โซ๏ธ โฎ๏ธ [๐ ๐จ ๐](./additional-responses.md){.internal-link target=_blank}.
๐ ๐ช โ ๐ ๐ *โก ๐ ๏ธ* โ๏ธ ๐ข `openapi_extra`.
### ๐ โ
๐ `openapi_extra` ๐ช ๐, ๐ผ, ๐ฃ [๐ โ](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#specificationExtensions):
```Python hl_lines="6"
{!../../../docs_src/path_operation_advanced_configuration/tutorial005.py!}
```
๐ฅ ๐ ๐ ๐ง ๐ ๏ธ ๐ฉบ, ๐ โ ๐ ๐ฆ ๐ ๐ ๐ฏ *โก ๐ ๏ธ*.
& ๐ฅ ๐ ๐ ๐ ๐ ( `/openapi.json` ๐ ๐ ๏ธ), ๐ ๐ ๐ ๐ โ ๐ ๐ฏ *โก ๐ ๏ธ* ๐โโ๏ธ:
```JSON hl_lines="22"
{
"openapi": "3.0.2",
"info": {
"title": "FastAPI",
"version": "0.1.0"
},
"paths": {
"/items/": {
"get": {
"summary": "Read Items",
"operationId": "read_items_items__get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
}
},
"x-aperture-labs-portal": "blue"
}
}
}
}
```
### ๐ ๐ *โก ๐ ๏ธ* ๐
๐ `openapi_extra` ๐ ๐ ๐ โฎ๏ธ ๐ ๐ ๐ ๐ *โก ๐ ๏ธ*.
, ๐ ๐ช ๐ฎ ๐ ๐ฝ ๐ ๐ ๐.
๐ผ, ๐ ๐ช ๐ญ โ & โ ๐จ โฎ๏ธ ๐ ๐ ๐, ๐ต โ๏ธ ๐ง โ FastAPI โฎ๏ธ Pydantic, โ๏ธ ๐ ๐ช ๐ ๐ฌ ๐จ ๐ ๐.
๐ ๐ช ๐ โฎ๏ธ `openapi_extra`:
```Python hl_lines="20-37 39-40"
{!../../../docs_src/path_operation_advanced_configuration/tutorial006.py!}
```
๐ ๐ผ, ๐ฅ ๐ซ ๐ฃ ๐ Pydantic ๐ท. ๐, ๐จ ๐ช ๐ซ ๐ป ๐ป, โซ๏ธ โ ๐ `bytes`, & ๐ข `magic_data_reader()` ๐ ๐ ๐ป โซ๏ธ ๐.
๐, ๐ฅ ๐ช ๐ฃ ๐ ๐ ๐จ ๐ช.
### ๐ ๐ ๐ ๐
โ๏ธ ๐ ๐ ๐ฑ, ๐ ๐ช โ๏ธ Pydantic ๐ท ๐ฌ ๐ป ๐ ๐ โคด๏ธ ๐ ๐ ๐ ๐ ๐ *โก ๐ ๏ธ*.
& ๐ ๐ช ๐ ๐ฅ ๐ฝ ๐ ๐จ ๐ซ ๐ป.
๐ผ, ๐ ๐ธ ๐ฅ ๐ซ โ๏ธ FastAPI ๐ ๏ธ ๐ ๏ธ โ ๐ป ๐ โช๏ธโก๏ธ Pydantic ๐ท ๐ซ ๐ง ๐ฌ ๐ป. ๐, ๐ฅ ๐ฃ ๐จ ๐ ๐ ๐, ๐ซ ๐ป:
```Python hl_lines="17-22 24"
{!../../../docs_src/path_operation_advanced_configuration/tutorial007.py!}
```
๐, ๐ ๐ฅ ๐ซ โ๏ธ ๐ข ๐ ๏ธ ๐ ๏ธ, ๐ฅ โ๏ธ Pydantic ๐ท โ ๐ ๐ป ๐ ๐ฝ ๐ ๐ฅ ๐ ๐จ ๐.
โคด๏ธ ๐ฅ โ๏ธ ๐จ ๐, & โ ๐ช `bytes`. ๐ โ ๐ FastAPI ๐ ๐ซ ๐ ๐ป ๐จ ๐ ๐ป.
& โคด๏ธ ๐ ๐, ๐ฅ ๐ป ๐ ๐ ๐ ๐, & โคด๏ธ ๐ฅ ๐ โ๏ธ ๐ Pydantic ๐ท โ ๐ ๐:
```Python hl_lines="26-33"
{!../../../docs_src/path_operation_advanced_configuration/tutorial007.py!}
```
!!! tip
๐ฅ ๐ฅ ๐ค-โ๏ธ ๐ Pydantic ๐ท.
โ๏ธ ๐ ๐, ๐ฅ ๐ช โ๏ธ โ โซ๏ธ ๐ ๐.