Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for arbitrary_types_allowed (0.1 sec)

  1. tests/test_arbitrary_types.py

            FakeNumpyArray,
            WithJsonSchema(TypeAdapter(list[float]).json_schema()),
            PlainSerializer(lambda v: v.data),
        ]
    
        class MyModel(BaseModel):
            model_config = ConfigDict(arbitrary_types_allowed=True)
            custom_field: FakeNumpyArrayPydantic
    
        app = FastAPI()
    
        @app.get("/")
        def test() -> MyModel:
            return MyModel(custom_field=FakeNumpyArray())
    
        client = TestClient(app)
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 20 15:55:38 UTC 2025
    - 3.8K bytes
    - Viewed (0)
  2. tests/test_jsonable_encoder.py

            model_config = {"arbitrary_types_allowed": True}
    
        test_path = PurePath("/foo", "bar")
        obj = ModelWithPath(path=test_path)
        assert jsonable_encoder(obj) == {"path": str(test_path)}
    
    
    def test_encode_model_with_pure_posix_path():
        class ModelWithPath(BaseModel):
            path: PurePosixPath
    
            model_config = {"arbitrary_types_allowed": True}
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 9.2K bytes
    - Viewed (0)
  3. tests/test_compat.py

            def __bool__(self):
                return False
    
        class EmbeddedModel(BaseModel):
            model_config = ConfigDict(arbitrary_types_allowed=True)
            value: Union[str, Missing] = Missing()
    
        class Model(BaseModel):
            model_config = ConfigDict(
                arbitrary_types_allowed=True,
            )
            value: Union[str, Missing] = Missing()
            embedded_model: EmbeddedModel = EmbeddedModel()
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 4.2K bytes
    - Viewed (0)
  4. tests/test_inherited_custom_class.py

            with pytest.raises(TypeError):
                vars(asyncpg_uuid)
            return {"fast_uuid": asyncpg_uuid}
    
        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():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 1.8K bytes
    - Viewed (0)
  5. docs/en/docs/release-notes.md

    ## 0.124.1
    
    ### Fixes
    
    * 🐛 Fix handling arbitrary types when using `arbitrary_types_allowed=True`. PR [#14482](https://github.com/fastapi/fastapi/pull/14482) by [@tiangolo](https://github.com/tiangolo).
    
    ### Docs
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 19:06:15 UTC 2025
    - 586.7K bytes
    - Viewed (0)
Back to top