- Sort Score
- Result 10 results
- Languages All
Results 541 - 550 of 849 for Pydantics (0.09 sec)
-
tests/test_tutorial/test_extra_models/test_tutorial003.py
"PlaneItem": { "title": "PlaneItem", "required": IsOneOf( ["description", "type", "size"], # TODO: remove when deprecating Pydantic v1 ["description", "size"], ), "type": "object", "properties": {
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Aug 04 20:47:07 UTC 2023 - 5.1K bytes - Viewed (0) -
docs_src/extra_models/tutorial001_py310.py
from fastapi import FastAPI from pydantic import BaseModel, EmailStr app = FastAPI() class UserIn(BaseModel): username: str password: str email: EmailStr full_name: str | None = None class UserOut(BaseModel): username: str email: EmailStr full_name: str | None = None class UserInDB(BaseModel): username: str hashed_password: str email: EmailStr
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jan 07 14:11:31 UTC 2022 - 899 bytes - Viewed (0) -
docs_src/path_operation_configuration/tutorial004_py39.py
from typing import Union from fastapi import FastAPI from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: Union[str, None] = None price: float tax: Union[float, None] = None tags: set[str] = set() @app.post("/items/", response_model=Item, summary="Create an item") async def create_item(item: Item): """ Create an item with all the information:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat May 14 11:59:59 UTC 2022 - 676 bytes - Viewed (0) -
tests/test_filter_pydantic_sub_model/app_pv1.py
from typing import Optional from fastapi import Depends, FastAPI from pydantic import BaseModel, validator app = FastAPI() class ModelB(BaseModel): username: str class ModelC(ModelB): password: str class ModelA(BaseModel): name: str description: Optional[str] = None model_b: ModelB @validator("name") def lower_username(cls, name: str, values):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 784 bytes - Viewed (0) -
docs_src/body_multiple_params/tutorial004_an_py310.py
from typing import Annotated from fastapi import Body, FastAPI from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: str | None = None price: float tax: float | None = None class User(BaseModel): username: str full_name: str | None = None @app.put("/items/{item_id}") async def update_item( *, item_id: int, item: Item,
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 643 bytes - Viewed (0) -
docs/em/docs/tutorial/query-params-str-validations.md
``` //// /// tip Pydantic, β β«οΈβ ποΈ π π½ π¬ & π οΈ FastAPI, βοΈ π π πβ π βοΈ `Optional` βοΈ `Union[Something, None]` π΅ π’ π², π πͺ β π π β«οΈ Pydantic π©Ί π <a href="https://docs.pydantic.dev/latest/concepts/models/#required-optional-fields" class="external-link" target="_blank">β π¦ π</a>. /// ### βοΈ Pydantic `Required` β©οΈ β (`...`)
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 11.7K bytes - Viewed (0) -
docs/de/docs/advanced/additional-responses.md
Jedes dieser Response-`dict`s kann einen SchlΓΌssel `model` haben, welcher ein Pydantic-Modell enthΓ€lt, genau wie `response_model`. **FastAPI** nimmt dieses Modell, generiert dessen JSON-Schema und fΓΌgt es an der richtigen Stelle in OpenAPI ein. Um beispielsweise eine weitere Response mit dem Statuscode `404` und einem Pydantic-Modell `Message` zu deklarieren, kΓΆnnen Sie schreiben: ```Python hl_lines="18 22"
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 9.6K bytes - Viewed (0) -
docs/en/docs/advanced/additional-responses.md
Each of those response `dict`s can have a key `model`, containing a Pydantic model, just like `response_model`. **FastAPI** will take that model, generate its JSON Schema and include it in the correct place in OpenAPI. For example, to declare another response with a status code `404` and a Pydantic model `Message`, you can write: {* ../../docs_src/additional_responses/tutorial001.py hl[18,22] *}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 27 16:07:07 UTC 2024 - 8.7K bytes - Viewed (0) -
docs_src/body_multiple_params/tutorial004.py
from typing import Union from fastapi import Body, FastAPI from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: Union[str, None] = None price: float tax: Union[float, None] = None class User(BaseModel): username: str full_name: Union[str, None] = None @app.put("/items/{item_id}") async def update_item( *, item_id: int,
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Mar 10 18:49:18 UTC 2023 - 653 bytes - Viewed (0) -
docs/ko/docs/advanced/response-directly.md
/// κ·Έλ¦¬κ³ `Response`λ₯Ό λ°ννλ©΄ **FastAPI**κ° μ΄λ₯Ό κ·Έλλ‘ μ λ¬ν©λλ€. Pydantic λͺ¨λΈλ‘ λ°μ΄ν° λ³νμ μννμ§ μμΌλ©°, λ΄μ©μ λ€λ₯Έ νμμΌλ‘ λ³ννμ§ μμ΅λλ€. μ΄λ‘ μΈν΄ λ§μ μ μ°μ±μ μ»μ μ μμ΅λλ€. μ΄λ€ λ°μ΄ν° μ νμ΄λ λ°νν μ μκ³ , λ°μ΄ν° μ μΈμ΄λ μ ν¨μ± κ²μ¬λ₯Ό μ¬μ μν μ μμ΅λλ€. ## `Response`μμ `jsonable_encoder` μ¬μ©νκΈ° **FastAPI**λ λ°ννλ `Response`μ μλ¬΄λ° λ³νμ νμ§ μμΌλ―λ‘, κ·Έ λ΄μ©μ΄ μ€λΉλμ΄ μμ΄μΌ ν©λλ€. μλ₯Ό λ€μ΄, Pydantic λͺ¨λΈμ `dict`λ‘ λ³νν΄ `JSONResponse`μ λ£μ§ μμΌλ©΄ JSON νΈν μ νμΌλ‘ λ³νλ λ°μ΄ν° μ ν(μ: `datetime`, `UUID` λ±)μ΄ μ¬μ©λμ§ μμ΅λλ€.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Oct 30 20:00:57 UTC 2024 - 3.4K bytes - Viewed (0)