- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 32 for classic (0.04 sec)
-
tests/test_inherited_custom_class.py
class SomeCustomClass(BaseModel): model_config = {"arbitrary_types_allowed": True} a_uuid: MyUuid @field_serializer("a_uuid") def serialize_a_uuid(self, v): return str(v) @app.get("/get_custom_class") def return_some_user(): # Test that the fix also works for custom pydantic classesRegistered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 12:54:56 UTC 2025 - 1.8K bytes - Viewed (0) -
scripts/translate.py
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 19:05:53 UTC 2025 - 34.1K bytes - Viewed (0) -
docs/en/docs/release-notes.md
as-is, including the `hashed_password`. To fix this, the declared `response_model` is cloned, if it is a Pydantic model class (or contains Pydantic model classes in it, e.g. in a `List[Item]`), the Pydantic model class(es) will be a different one (the "cloned" one). So, an object that is a subclass won't simply pass the validation and returned as-is, because it is no longer a sub-class of the cloned `response_model`. Instead, a new Pydantic model object will be created with the contents of the returned...
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 19:06:15 UTC 2025 - 586.7K bytes - Viewed (0) -
fastapi/exceptions.py
WebSocketErrorModel: type[BaseModel] = create_model("WebSocket") class FastAPIError(RuntimeError): """ A generic, FastAPI-specific error. """ class DependencyScopeError(FastAPIError): """ A dependency declared that it depends on another dependency with an invalid (narrower) scope. """ class ValidationException(Exception): def __init__( self,
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 12:54:56 UTC 2025 - 6.8K bytes - Viewed (0) -
fastapi/openapi/utils.py
else: # It would probably make more sense for all response classes to have an # explicit default status_code, and to extract it from them, instead of # doing this inspection tricks, that would probably be in the future # TODO: probably make status_code a default class attribute for all # responses in StarletteRegistered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 12:54:56 UTC 2025 - 23.2K bytes - Viewed (0) -
tests/test_filter_pydantic_sub_model_pv2.py
@pytest.fixture(name="client") def get_client(): from pydantic import BaseModel, ValidationInfo, field_validator app = FastAPI() class ModelB(BaseModel): username: str class ModelC(ModelB): password: str class ModelA(BaseModel): name: str description: Optional[str] = None foo: ModelB tags: dict[str, str] = {}
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 6.6K bytes - Viewed (0) -
tests/test_request_params/test_query/test_optional_str.py
# ===================================================================================== # Without aliases @app.get("/optional-str") async def read_optional_str(p: Optional[str] = None): return {"p": p} class QueryModelOptionalStr(BaseModel): p: Optional[str] = None @app.get("/model-optional-str") async def read_model_optional_str(p: Annotated[QueryModelOptionalStr, Query()]): return {"p": p.p}
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 8.1K bytes - Viewed (0) -
tests/test_request_params/test_cookie/test_required_str.py
# Without aliases @app.get("/required-str") async def read_required_str(p: Annotated[str, Cookie()]): return {"p": p} class CookieModelRequiredStr(BaseModel): p: str @app.get("/model-required-str") async def read_model_required_str(p: Annotated[CookieModelRequiredStr, Cookie()]): return {"p": p.p}
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 10.2K bytes - Viewed (0) -
tests/test_get_model_definitions_formfeed_escape.py
def client_fixture() -> TestClient: from pydantic import BaseModel class Address(BaseModel): """ This is a public description of an Address \f You can't see this part of the docstring, it's private! """ line_1: str city: str state_province: str class Facility(BaseModel): id: str address: Address app = FastAPI()
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 12:54:56 UTC 2025 - 5.8K bytes - Viewed (0) -
tests/test_request_params/test_form/test_list.py
# Without aliases @app.post("/required-list-str", operation_id="required_list_str") async def read_required_list_str(p: Annotated[list[str], Form()]): return {"p": p} class FormModelRequiredListStr(BaseModel): p: list[str] @app.post("/model-required-list-str", operation_id="model_required_list_str") def read_model_required_list_str(p: Annotated[FormModelRequiredListStr, Form()]):
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:31:34 UTC 2025 - 11.7K bytes - Viewed (0)