- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 54 for jsonable_encoder (0.08 sec)
-
fastapi/openapi/utils.py
example = getattr(field_info, "example", None) if openapi_examples: parameter["examples"] = jsonable_encoder(openapi_examples) elif example != Undefined: parameter["example"] = jsonable_encoder(example) if getattr(field_info, "deprecated", None): parameter["deprecated"] = True parameters.append(parameter)
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Sep 17 18:54:10 UTC 2024 - 22.6K bytes - Viewed (0) -
docs/en/docs/advanced/response-directly.md
When you create a **FastAPI** *path operation* you can normally return any data from it: a `dict`, a `list`, a Pydantic model, a database model, etc. By default, **FastAPI** would automatically convert that return value to JSON using the `jsonable_encoder` explained in [JSON Compatible Encoder](../tutorial/encoder.md){.internal-link target=_blank}.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 3K bytes - Viewed (0) -
docs_src/body_updates/tutorial001.py
from typing import List, Union from fastapi import FastAPI from fastapi.encoders import jsonable_encoder from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: Union[str, None] = None description: Union[str, None] = None price: Union[float, None] = None tax: float = 10.5 tags: List[str] = [] items = { "foo": {"name": "Foo", "price": 50.2},
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat May 14 11:59:59 UTC 2022 - 906 bytes - Viewed (0) -
docs_src/body_updates/tutorial002_py310.py
from fastapi import FastAPI from fastapi.encoders import jsonable_encoder from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str | None = None description: str | None = None price: float | None = None tax: float = 10.5 tags: list[str] = [] items = { "foo": {"name": "Foo", "price": 50.2}, "bar": {"name": "Bar", "description": "The bartenders", "price": 62, "tax": 20.2},
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jan 07 14:11:31 UTC 2022 - 1010 bytes - Viewed (0) -
docs_src/encoder/tutorial001_py310.py
from fastapi import FastAPI from fastapi.encoders import jsonable_encoder from pydantic import BaseModel fake_db = {} class Item(BaseModel): title: str timestamp: datetime description: str | None = None app = FastAPI() @app.put("/items/{id}") def update_item(id: str, item: Item): json_compatible_item_data = jsonable_encoder(item)
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jan 07 14:11:31 UTC 2022 - 430 bytes - Viewed (0) -
docs_src/body_updates/tutorial002.py
from typing import List, Union from fastapi import FastAPI from fastapi.encoders import jsonable_encoder from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: Union[str, None] = None description: Union[str, None] = None price: Union[float, None] = None tax: float = 10.5 tags: List[str] = [] items = { "foo": {"name": "Foo", "price": 50.2},
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat May 14 11:59:59 UTC 2022 - 1K bytes - Viewed (0) -
docs/em/docs/advanced/response-directly.md
๐ ๐ค ๐ ๐ ๐ช. ๐ ๐ช ๐จ ๐ ๐ ๐, ๐ ๐ ๐ฝ ๐ โ๏ธ ๐ฌ, โ๏ธ. ## โ๏ธ `jsonable_encoder` `Response` โฉ๏ธ **FastAPI** ๐ซ ๐ ๐ `Response` ๐ ๐จ, ๐ โ๏ธ โ ๐ญ โซ๏ธ ๐ ๐ โซ๏ธ. ๐ผ, ๐ ๐ซ๐ ๐ฎ Pydantic ๐ท `JSONResponse` ๐ต ๐ฅ ๐ญ โซ๏ธ `dict` โฎ๏ธ ๐ ๐ ๐ (๐ `datetime`, `UUID`, โ๏ธ) ๐ ๐ป-๐ ๐. ๐ ๐ผ, ๐ ๐ช โ๏ธ `jsonable_encoder` ๐ ๐ ๐ โญ ๐ถโโ๏ธ โซ๏ธ ๐จ: ```Python hl_lines="6-7 21-22"
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 2.6K bytes - Viewed (0) -
docs/de/docs/advanced/response-directly.md
Standardmรครig konvertiert **FastAPI** diesen Rรผckgabewert automatisch nach JSON, mithilfe des `jsonable_encoder`, der in [JSON-kompatibler Encoder](../tutorial/encoder.md){.internal-link target=_blank} erlรคutert wird.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 3.5K bytes - Viewed (0) -
docs/es/docs/advanced/response-directly.md
Por defecto, **FastAPI** convertirรญa automรกticamente ese valor devuelto a JSON usando el `jsonable_encoder` explicado en [Codificador Compatible JSON](../tutorial/encoder.md){.internal-link target=_blank}.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 3.2K bytes - Viewed (0) -
docs/ko/docs/advanced/response-directly.md
์ด๋ก ์ธํด ๋ง์ ์ ์ฐ์ฑ์ ์ป์ ์ ์์ต๋๋ค. ์ด๋ค ๋ฐ์ดํฐ ์ ํ์ด๋ ๋ฐํํ ์ ์๊ณ , ๋ฐ์ดํฐ ์ ์ธ์ด๋ ์ ํจ์ฑ ๊ฒ์ฌ๋ฅผ ์ฌ์ ์ํ ์ ์์ต๋๋ค. ## `Response`์์ `jsonable_encoder` ์ฌ์ฉํ๊ธฐ **FastAPI**๋ ๋ฐํํ๋ `Response`์ ์๋ฌด๋ฐ ๋ณํ์ ํ์ง ์์ผ๋ฏ๋ก, ๊ทธ ๋ด์ฉ์ด ์ค๋น๋์ด ์์ด์ผ ํฉ๋๋ค. ์๋ฅผ ๋ค์ด, Pydantic ๋ชจ๋ธ์ `dict`๋ก ๋ณํํด `JSONResponse`์ ๋ฃ์ง ์์ผ๋ฉด JSON ํธํ ์ ํ์ผ๋ก ๋ณํ๋ ๋ฐ์ดํฐ ์ ํ(์: `datetime`, `UUID` ๋ฑ)์ด ์ฌ์ฉ๋์ง ์์ต๋๋ค. ์ด๋ฌํ ๊ฒฝ์ฐ, ๋ฐ์ดํฐ๋ฅผ ์๋ต์ ์ ๋ฌํ๊ธฐ ์ ์ `jsonable_encoder`๋ฅผ ์ฌ์ฉํ์ฌ ๋ณํํ ์ ์์ต๋๋ค: ```Python hl_lines="6-7 21-22"
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Oct 30 20:00:57 UTC 2024 - 3.4K bytes - Viewed (0)