- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 107 for valid1 (0.15 sec)
-
tests/test_response_model_sub_types.py
app = FastAPI() @app.get("/valid1", responses={"500": {"model": int}}) def valid1(): pass @app.get("/valid2", responses={"500": {"model": List[int]}}) def valid2(): pass @app.get("/valid3", responses={"500": {"model": Model}}) def valid3(): pass @app.get("/valid4", responses={"500": {"model": List[Model]}}) def valid4(): pass client = TestClient(app)
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 5.3K bytes - Viewed (0) -
docs/fr/docs/tutorial/query-params-str-validations.md
```Python q: Union[str, None] = Query(default=None, max_length=50) ``` Cela va valider les données, montrer une erreur claire si ces dernières ne sont pas valides, et documenter le paramètre dans le schéma `OpenAPI` de cette *path operation*. ## Rajouter plus de validation Vous pouvez aussi rajouter un second paramètre `min_length` :
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Jul 27 18:53:21 GMT 2023 - 9.8K bytes - Viewed (0) -
tests/test_serialize_response.py
app = FastAPI() class Item(BaseModel): name: str price: Optional[float] = None owner_ids: Optional[List[int]] = None @app.get("/items/valid", response_model=Item) def get_valid(): return {"name": "valid", "price": 1.0} @app.get("/items/coerce", response_model=Item) def get_coerce(): return {"name": "coerce", "price": "1.0"}
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Mon Aug 03 12:29:07 GMT 2020 - 1.4K bytes - Viewed (0) -
tests/test_query.py
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 21:56:59 GMT 2024 - 11.4K bytes - Viewed (0) -
tests/test_tutorial/test_body/test_tutorial001_py310.py
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 15K bytes - Viewed (2) -
tests/test_tutorial/test_body/test_tutorial001.py
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 14.7K bytes - Viewed (7) -
tests/test_validate_response.py
with pytest.raises(ResponseValidationError): client.get("/items/invalidnone") def test_valid_none_data(): response = client.get("/items/validnone") data = response.json() assert response.status_code == 200 assert data == {"name": "invalid", "price": 3.2, "owner_ids": None} def test_valid_none_none(): response = client.get("/items/validnone", params={"send_none": "true"}) data = response.json()
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 2K bytes - Viewed (0) -
tests/test_tutorial/test_query_params/test_tutorial006_py310.py
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 6.2K bytes - Viewed (0) -
tests/test_tutorial/test_handling_errors/test_tutorial005.py
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 4.3K bytes - Viewed (0) -
docs/en/docs/tutorial/path-params.md
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 9.1K bytes - Viewed (0)