Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 4 of 4 for TypeAdapter (0.07 seconds)

  1. tests/test_arbitrary_types.py

            BaseModel,
            ConfigDict,
            PlainSerializer,
            TypeAdapter,
            WithJsonSchema,
        )
    
        class FakeNumpyArray:
            def __init__(self):
                self.data = [1.0, 2.0, 3.0]
    
        FakeNumpyArrayPydantic = Annotated[
            FakeNumpyArray,
            WithJsonSchema(TypeAdapter(list[float]).json_schema()),
            PlainSerializer(lambda v: v.data),
        ]
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Dec 20 15:55:38 GMT 2025
    - 3.8K bytes
    - Click Count (0)
  2. fastapi/_compat/v2.py

                    # the old field info metadata and only the rest of the attributes
                    Field(**field_dict["attributes"]),
                )
                self._type_adapter: TypeAdapter[Any] = TypeAdapter(
                    Annotated[annotated_args],  # ty: ignore[invalid-type-form]
                    config=self.config,
                )
    
        def get_default(self) -> Any:
            if self.field_info.is_required():
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 15 11:44:39 GMT 2026
    - 16.7K bytes
    - Click Count (0)
  3. fastapi/.agents/skills/fastapi/SKILL.md

        pass
    
    
    @app.post("/items/")
    async def create_items(items: ItemList):
        return items
    
    ```
    
    FastAPI supports these type annotations and will create a Pydantic `TypeAdapter` for them, so that types can work as normally and there's no need for the custom logic and types in RootModels.
    
    ## Use one HTTP operation per function
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 01 10:05:57 GMT 2026
    - 10.1K bytes
    - Click Count (0)
  4. fastapi/routing.py

                        )
                        # Use the fast path (dump_json) when no custom response
                        # class was set and a response field with a TypeAdapter
                        # exists. Serializes directly to JSON bytes via Pydantic's
                        # Rust core, skipping the intermediate Python dict +
                        # json.dumps() step.
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 15 11:44:39 GMT 2026
    - 193K bytes
    - Click Count (0)
Back to Top