- Sort Score
- Result 10 results
- Languages All
Results 721 - 730 of 849 for Pydantics (0.09 sec)
-
docs/ru/docs/tutorial/body-multiple-params.md
```Python hl_lines="22" {!> ../../docs_src/body_multiple_params/tutorial002.py!} ``` //// В этом случае **FastAPI** заметит, что в функции есть более одного параметра тела (два параметра, которые являются моделями Pydantic). Таким образом, имена параметров будут использоваться в качестве ключей (имён полей) в теле запроса, и будет ожидаться запрос следующего формата: ```JSON { "item": { "name": "Foo",
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 11.6K bytes - Viewed (0) -
scripts/deploy_docs_status.py
import logging import re from github import Github from pydantic import SecretStr from pydantic_settings import BaseSettings class Settings(BaseSettings): github_repository: str github_token: SecretStr deploy_url: str | None = None commit_sha: str run_id: int is_done: bool = False def main(): logging.basicConfig(level=logging.INFO) settings = Settings()
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Aug 09 15:52:41 UTC 2024 - 3.1K bytes - Viewed (0) -
fastapi/openapi/models.py
) from fastapi.logger import logger from pydantic import AnyUrl, BaseModel, Field from typing_extensions import Annotated, Literal, TypedDict from typing_extensions import deprecated as typing_deprecated try: import email_validator assert email_validator # make autoflake ignore the unused import from pydantic import EmailStr except ImportError: # pragma: no cover
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 22:49:33 UTC 2024 - 15K bytes - Viewed (0) -
tests/test_serialize_response_model.py
from typing import Dict, List, Optional from fastapi import FastAPI from pydantic import BaseModel, Field from starlette.testclient import TestClient app = FastAPI() class Item(BaseModel): name: str = Field(alias="aliased_name") price: Optional[float] = None owner_ids: Optional[List[int]] = None @app.get("/items/valid", response_model=Item) def get_valid(): return Item(aliased_name="valid", price=1.0)
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri May 13 23:38:22 UTC 2022 - 4.2K bytes - Viewed (0) -
tests/test_invalid_path_param.py
from typing import Dict, List, Tuple import pytest from fastapi import FastAPI from pydantic import BaseModel def test_invalid_sequence(): with pytest.raises(AssertionError): app = FastAPI() class Item(BaseModel): title: str @app.get("/items/{id}") def read_items(id: List[Item]): pass # pragma: no cover def test_invalid_tuple():
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Mon Jun 03 17:59:40 UTC 2019 - 1.7K bytes - Viewed (0) -
tests/test_response_model_data_filter.py
from typing import List from fastapi import FastAPI from fastapi.testclient import TestClient from pydantic import BaseModel app = FastAPI() class UserBase(BaseModel): email: str class UserCreate(UserBase): password: str class UserDB(UserBase): hashed_password: str class PetDB(BaseModel): name: str owner: UserDB class PetOut(BaseModel): name: str
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 1.7K bytes - Viewed (0) -
docs/de/docs/advanced/using-request-directly.md
Obwohl jeder andere normal deklarierte Parameter (z. B. der Body, mit einem Pydantic-Modell) dennoch validiert, konvertiert, annotiert, usw. werden würde. Es gibt jedoch bestimmte Fälle, in denen es nützlich ist, auf das `Request`-Objekt zuzugreifen. ## Das `Request`-Objekt direkt verwenden
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 2.5K bytes - Viewed (0) -
tests/test_additional_responses_router.py
from fastapi import APIRouter, FastAPI from fastapi.testclient import TestClient from pydantic import BaseModel class ResponseModel(BaseModel): message: str app = FastAPI() router = APIRouter() @router.get("/a", responses={501: {"description": "Error 1"}}) async def a(): return "a" @router.get( "/b", responses={ 502: {"description": "Error 2"},
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 5.1K bytes - Viewed (0) -
docs/fr/docs/tutorial/body-multiple-params.md
```Python hl_lines="22" {!> ../../docs_src/body_multiple_params/tutorial002.py!} ``` //// Dans ce cas, **FastAPI** détectera qu'il y a plus d'un paramètre dans le body (chacun correspondant à un modèle Pydantic). Il utilisera alors les noms des paramètres comme clés, et s'attendra à recevoir quelque chose de semblable à : ```JSON { "item": { "name": "Foo", "description": "The pretender",
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 8.5K bytes - Viewed (0) -
docs/de/docs/advanced/security/oauth2-scopes.md
Und dann validieren wir diese Daten mit dem Pydantic-Modell (wobei wir die `ValidationError`-Exception abfangen), und wenn wir beim Lesen des JWT-Tokens oder beim Validieren der Daten mit Pydantic einen Fehler erhalten, lösen wir die zuvor erstellte `HTTPException` aus. Dazu aktualisieren wir das Pydantic-Modell `TokenData` mit einem neuen Attribut `scopes`.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 22.5K bytes - Viewed (0)