- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 19 for openapi_examples (0.08 seconds)
-
docs/en/docs/tutorial/schema-extra-example.md
This doesn't go inside of each JSON Schema contained in OpenAPI, this goes outside, in the *path operation* directly. ### Using the `openapi_examples` Parameter { #using-the-openapi-examples-parameter } You can declare the OpenAPI-specific `examples` in FastAPI with the parameter `openapi_examples` for: * `Path()` * `Query()` * `Header()` * `Cookie()` * `Body()` * `Form()` * `File()`
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 8.7K bytes - Click Count (0) -
fastapi/params.py
category=FastAPIDeprecationWarning, stacklevel=4, ) self.example = example self.include_in_schema = include_in_schema self.openapi_examples = openapi_examples kwargs = dict( default=default, default_factory=default_factory, alias=alias, title=title, description=description, gt=gt,Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 15 11:44:39 GMT 2026 - 25.7K bytes - Click Count (0) -
fastapi/param_functions.py
multiple_of=multiple_of, allow_inf_nan=allow_inf_nan, max_digits=max_digits, decimal_places=decimal_places, example=example, examples=examples, openapi_examples=openapi_examples, deprecated=deprecated, include_in_schema=include_in_schema, json_schema_extra=json_schema_extra, **extra, ) def Query( # noqa: N802Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 15 11:44:39 GMT 2026 - 68K bytes - Click Count (0) -
tests/test_openapi_examples.py
class Item(BaseModel): data: str @app.post("/examples/") def examples( item: Item = Body( examples=[ {"data": "Data in Body examples, example1"}, ], openapi_examples={ "Example One": { "summary": "Example One Summary", "description": "Example One Description", "value": {"data": "Data in Body examples, example1"},
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 09:59:14 GMT 2026 - 16.4K bytes - Click Count (0) -
docs/ja/docs/tutorial/schema-extra-example.md
このOpenAPI固有フィールド`examples`の形は**複数の例**(`list`ではなく)を持つ`dict`であり、それぞれに追加情報が含まれ、その追加情報は**OpenAPI**にも追加されます。 これはOpenAPIに含まれる各JSON Schemaの中には入らず、外側の、*path operation*に直接入ります。 ### `openapi_examples`パラメータの使用 { #using-the-openapi-examples-parameter } FastAPIでは、以下に対してパラメータ`openapi_examples`を使って、OpenAPI固有の`examples`を宣言できます: * `Path()` * `Query()` * `Header()` * `Cookie()` * `Body()` * `Form()` * `File()`Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:07:17 GMT 2026 - 10.5K bytes - Click Count (0) -
docs/zh/docs/tutorial/schema-extra-example.md
这个 OpenAPI 特定字段 `examples` 的结构是一个包含多个示例的 `dict`(而不是一个 `list`),每个示例都包含会被添加到 OpenAPI 的额外信息。 这不放在 OpenAPI 内部包含的各个 JSON Schema 里,而是直接放在路径操作上。 ### 使用 `openapi_examples` 参数 { #using-the-openapi-examples-parameter } 你可以在 FastAPI 中通过参数 `openapi_examples` 来声明这个 OpenAPI 特定的 `examples`,适用于: - `Path()` - `Query()` - `Header()` - `Cookie()` - `Body()` - `Form()` - `File()`Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:06:37 GMT 2026 - 8.5K bytes - Click Count (0) -
docs/zh-hant/docs/tutorial/schema-extra-example.md
這個 OpenAPI 特定欄位 `examples` 的結構是一個包含「多個範例」的 `dict`(而非 `list`),每個範例都可包含會一併加入到 **OpenAPI** 的額外資訊。 它不會出現在 OpenAPI 所含的各個 JSON Schema 內,而是直接放在對應的「路徑操作」上。 ### 使用 `openapi_examples` 參數 { #using-the-openapi-examples-parameter } 你可以在 FastAPI 中透過參數 `openapi_examples` 為下列項目宣告 OpenAPI 特定的 `examples`: * `Path()` * `Query()` * `Header()` * `Cookie()` * `Body()` * `Form()` * `File()`Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 8.4K bytes - Click Count (0) -
fastapi/openapi/utils.py
if field_info.description: parameter["description"] = field_info.description openapi_examples = getattr(field_info, "openapi_examples", None) example = getattr(field_info, "example", None) if openapi_examples: parameter["examples"] = jsonable_encoder(openapi_examples) elif example is not _Unset: parameter["example"] = jsonable_encoder(example)Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 15 11:44:39 GMT 2026 - 25.6K bytes - Click Count (0) -
docs_src/schema_extra_example/tutorial005_py310.py
description: str | None = None price: float tax: float | None = None @app.put("/items/{item_id}") async def update_item( *, item_id: int, item: Item = Body( openapi_examples={ "normal": { "summary": "A normal example", "description": "A **normal** item works correctly.", "value": { "name": "Foo",Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Aug 26 18:03:13 GMT 2023 - 1.3K bytes - Click Count (0) -
docs_src/schema_extra_example/tutorial005_an_py310.py
price: float tax: float | None = None @app.put("/items/{item_id}") async def update_item( *, item_id: int, item: Annotated[ Item, Body( openapi_examples={ "normal": { "summary": "A normal example", "description": "A **normal** item works correctly.", "value": {Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Aug 26 18:03:13 GMT 2023 - 1.5K bytes - Click Count (0)