Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 35 for ModelC (0.07 sec)

  1. tests/test_filter_pydantic_sub_model_pv2.py

        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] = {}
    
            @field_validator("name")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 6.6K bytes
    - Viewed (0)
  2. tests/test_response_model_as_return_annotation.py

                        },
                    }
                },
                "/response_model_model1-annotation_model2-return_same_model": {
                    "get": {
                        "summary": "Response Model Model1 Annotation Model2 Return Same Model",
                        "operationId": "response_model_model1_annotation_model2_return_same_model_response_model_model1_annotation_model2_return_same_model_get",
                        "responses": {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 47.7K bytes
    - Viewed (0)
  3. fastapi/openapi/models.py

    Sebastián Ramírez <******@****.***> 1766840096 -0800
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 15.1K bytes
    - Viewed (0)
  4. tests/test_tuples.py

        response = client.post("/tuple-of-models/", json=data)
        assert response.status_code == 422, response.text
    
        data = [{"x": 1, "y": 2}]
        response = client.post("/tuple-of-models/", json=data)
        assert response.status_code == 422, response.text
    
    
    def test_tuple_form_valid():
        response = client.post("/tuple-form/", data={"values": ("1", "2")})
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 9.8K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_path_params/test_tutorial005.py

    client = TestClient(app)
    
    
    def test_get_enums_alexnet():
        response = client.get("/models/alexnet")
        assert response.status_code == 200
        assert response.json() == {"model_name": "alexnet", "message": "Deep Learning FTW!"}
    
    
    def test_get_enums_lenet():
        response = client.get("/models/lenet")
        assert response.status_code == 200
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 4.1K bytes
    - Viewed (0)
  6. fastapi/utils.py

        version: Literal["1", "auto"] = "auto",
    ) -> ModelField:
        if annotation_is_pydantic_v1(type_):
            raise PydanticV1NotSupportedError(
                "pydantic.v1 models are no longer supported by FastAPI."
                f" Please update the response model {type_!r}."
            )
        class_validators = class_validators or {}
    
        field_info = field_info or FieldInfo(annotation=type_, default=default, alias=alias)
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 5.1K bytes
    - Viewed (0)
  7. fastapi/encoders.py

            Doc(
                """
                Pydantic's `include` parameter, passed to Pydantic models to set the
                fields to include.
                """
            ),
        ] = None,
        exclude: Annotated[
            Optional[IncEx],
            Doc(
                """
                Pydantic's `exclude` parameter, passed to Pydantic models to set the
                fields to exclude.
                """
            ),
        ] = None,
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 10.7K bytes
    - Viewed (0)
  8. fastapi/_compat/v2.py

                field_info=FieldInfo(annotation=model),
                name=model.__name__,
                mode="validation",
            )
            for model in flat_validation_models
        ]
        flat_serialization_model_fields = [
            ModelField(
                field_info=FieldInfo(annotation=model),
                name=model.__name__,
                mode="serialization",
            )
            for model in flat_serialization_models
        ]
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 19.1K bytes
    - Viewed (0)
  9. fastapi/routing.py

                    if annotation_is_pydantic_v1(model):
                        raise PydanticV1NotSupportedError(
                            "pydantic.v1 models are no longer supported by FastAPI."
                            f" In responses={{}}, please update {model}."
                        )
                    response_field = create_model_field(
                        name=response_name, type_=model, mode="serialization"
                    )
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 174.6K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_sql_databases/test_tutorial001.py

    from sqlmodel.main import default_registry
    
    from tests.utils import needs_py310
    
    
    def clear_sqlmodel():
        # Clear the tables in the metadata for the default base model
        SQLModel.metadata.clear()
        # Clear the Models associated with the registry, to avoid warnings
        default_registry.dispose()
    
    
    @pytest.fixture(
        name="client",
        params=[
            pytest.param("tutorial001_py39"),
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 14K bytes
    - Viewed (0)
Back to top