- Sort Score
- Result 10 results
- Languages All
Results 171 - 180 of 1,992 for Fastapi (0.04 sec)
-
tests/test_ambiguous_params.py
from typing import Annotated import pytest from fastapi import Depends, FastAPI, Path from fastapi.param_functions import Query from fastapi.testclient import TestClient app = FastAPI() def test_no_annotated_defaults(): with pytest.raises( AssertionError, match="Path parameters cannot have a default value" ): @app.get("/items/{item_id}/") async def get_item(item_id: Annotated[int, Path(default=1)]):
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 20 15:55:38 UTC 2025 - 2K bytes - Viewed (1) -
docs/ru/docs/advanced/response-cookies.md
**FastAPI** предоставляет `fastapi.responses`, которые являются теми же объектами, что и `starlette.responses`, просто для удобства. Однако большинство доступных типов ответов поступает непосредственно из **Starlette**. И так как `Response` часто используется для установки HTTP-заголовков и cookies, **FastAPI** также предоставляет его как `fastapi.Response`. ///
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 3.6K bytes - Viewed (0) -
docs_src/additional_responses/tutorial004_py39.py
from typing import Union from fastapi import FastAPI from fastapi.responses import FileResponse from pydantic import BaseModel class Item(BaseModel): id: str value: str responses = { 404: {"description": "Item not found"}, 302: {"description": "The item was moved"}, 403: {"description": "Not enough privileges"}, } app = FastAPI() @app.get( "/items/{item_id}",
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 701 bytes - Viewed (0) -
fastapi/openapi/docs.py
for example the URLs to use to load Swagger UI's JavaScript and CSS. Read more about it in the [FastAPI docs for Configure Swagger UI](https://fastapi.tiangolo.com/how-to/configure-swagger-ui/) and the [FastAPI docs for Custom Docs UI Static Assets (Self-Hosting)](https://fastapi.tiangolo.com/how-to/custom-docs-ui-assets/). """ current_swagger_ui_parameters = swagger_ui_default_parameters.copy()
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 10.1K bytes - Viewed (0) -
docs/en/docs/deployment/versions.md
You can create production applications with **FastAPI** right now (and you have probably been doing it for some time), you just have to make sure that you use a version that works correctly with the rest of your code. ## Pin your `fastapi` version { #pin-your-fastapi-version }
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sun Aug 31 09:15:41 UTC 2025 - 3.5K bytes - Viewed (0) -
docs/es/docs/deployment/versions.md
Puedes crear aplicaciones de producción con **FastAPI** ahora mismo (y probablemente ya lo has estado haciendo desde hace algún tiempo), solo debes asegurarte de que utilizas una versión que funciona correctamente con el resto de tu código. ## Fija tu versión de `fastapi` { #pin-your-fastapi-version }
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Tue Dec 16 16:33:45 UTC 2025 - 3.9K bytes - Viewed (0) -
docs/en/docs/how-to/migrate-from-pydantic-v1-to-pydantic-v2.md
If you have an old FastAPI app, you might be using Pydantic version 1. FastAPI version 0.100.0 had support for either Pydantic v1 or v2. It would use whichever you had installed. FastAPI version 0.119.0 introduced partial support for Pydantic v1 from inside of Pydantic v2 (as `pydantic.v1`), to facilitate the migration to v2.
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 20 15:55:38 UTC 2025 - 5.5K bytes - Viewed (0) -
tests/test_datastructures.py
import io from pathlib import Path import pytest from fastapi import FastAPI, UploadFile from fastapi.datastructures import Default from fastapi.testclient import TestClient def test_upload_file_invalid_pydantic_v2(): with pytest.raises(ValueError): UploadFile._validate("not a Starlette UploadFile", {}) def test_default_placeholder_equals(): placeholder_1 = Default("a") placeholder_2 = Default("a")
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 20 15:55:38 UTC 2025 - 1.8K bytes - Viewed (0) -
tests/test_get_request_body.py
from fastapi import FastAPI from fastapi.testclient import TestClient from pydantic import BaseModel app = FastAPI() class Product(BaseModel): name: str description: str = None # type: ignore price: float @app.get("/product") async def create_item(product: Product): return product client = TestClient(app) def test_get_with_body():
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 3.7K bytes - Viewed (0) -
tests/test_repeated_dependency_schema.py
from fastapi import Depends, FastAPI, Header, status from fastapi.testclient import TestClient app = FastAPI() def get_header(*, someheader: str = Header()): return someheader def get_something_else(*, someheader: str = Depends(get_header)): return f"{someheader}123" @app.get("/") def get_deps(dep1: str = Depends(get_header), dep2: str = Depends(get_something_else)): return {"dep1": dep1, "dep2": dep2}
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Thu Mar 06 12:18:57 UTC 2025 - 3.2K bytes - Viewed (0)