Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 23 for asdict (0.03 sec)

  1. fastapi/_compat/v2.py

                    )
                # TODO: remove after dropping support for Python 3.8 and
                # setting the min Pydantic to v2.12.3 that adds asdict()
                field_dict = asdict(self.field_info)
                annotated_args = (
                    field_dict["annotation"],
                    *field_dict["metadata"],
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 19.1K bytes
    - Viewed (0)
  2. fastapi/encoders.py

        SecretStr: str,
        set: list,
        UUID: str,
        Url: str,
        AnyUrl: str,
    }
    
    
    def generate_encoders_by_class_tuples(
        type_encoder_map: dict[Any, Callable[[Any], Any]],
    ) -> dict[Callable[[Any], Any], tuple[Any, ...]]:
        encoders_by_class_tuples: dict[Callable[[Any], Any], tuple[Any, ...]] = defaultdict(
            tuple
        )
        for type_, encoder in type_encoder_map.items():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 10.7K bytes
    - Viewed (0)
  3. tests/test_jsonable_encoder.py

            "bar": "bar",
            "bla": "bla",
        }
    
    
    def test_custom_encoders():
        class safe_datetime(datetime):
            pass
    
        class MyDict(TypedDict):
            dt_field: safe_datetime
    
        instance = MyDict(dt_field=safe_datetime.now())
    
        encoded_instance = jsonable_encoder(
            instance, custom_encoder={safe_datetime: lambda o: o.strftime("%H:%M:%S")}
        )
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 9.2K bytes
    - Viewed (0)
  4. fastapi/openapi/models.py

        schemas: Optional[dict[str, Union[Schema, Reference]]] = None
        responses: Optional[dict[str, Union[Response, Reference]]] = None
        parameters: Optional[dict[str, Union[Parameter, Reference]]] = None
        examples: Optional[dict[str, Union[Example, Reference]]] = None
        requestBodies: Optional[dict[str, Union[RequestBody, Reference]]] = None
        headers: Optional[dict[str, Union[Header, Reference]]] = None
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 15.1K bytes
    - Viewed (0)
  5. fastapi/openapi/utils.py

        operation_ids: set[str],
        model_name_map: ModelNameMap,
        field_mapping: dict[
            tuple[ModelField, Literal["validation", "serialization"]], dict[str, Any]
        ],
        separate_input_output_schemas: bool = True,
    ) -> tuple[dict[str, Any], dict[str, Any], dict[str, Any]]:
        path = {}
        security_schemes: dict[str, Any] = {}
        definitions: dict[str, Any] = {}
        assert route.methods is not None, "Methods must be a list"
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 23.2K bytes
    - Viewed (0)
  6. fastapi/utils.py

        return operation_id
    
    
    def deep_dict_update(main_dict: dict[Any, Any], update_dict: dict[Any, Any]) -> None:
        for key, value in update_dict.items():
            if (
                key in main_dict
                and isinstance(main_dict[key], dict)
                and isinstance(value, dict)
            ):
                deep_dict_update(main_dict[key], value)
            elif (
    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/params.py

                    "although still supported. Use examples instead."
                ),
            ] = _Unset,
            openapi_examples: Optional[dict[str, Example]] = None,
            deprecated: Union[deprecated, str, bool, None] = None,
            include_in_schema: bool = True,
            json_schema_extra: Union[dict[str, Any], None] = None,
            **extra: Any,
        ):
            if example is not _Unset:
                warnings.warn(
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 26.3K bytes
    - Viewed (0)
  8. fastapi/dependencies/utils.py

        return values
    
    
    async def request_body_to_args(
        body_fields: list[ModelField],
        received_body: Optional[Union[dict[str, Any], FormData]],
        embed_body_fields: bool,
    ) -> tuple[dict[str, Any], list[dict[str, Any]]]:
        values: dict[str, Any] = {}
        errors: list[dict[str, Any]] = []
        assert body_fields, "request_body_to_args() should be called with fields"
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 37.6K bytes
    - Viewed (3)
  9. fastapi/routing.py

            summary: Optional[str] = None,
            description: Optional[str] = None,
            response_description: str = "Successful Response",
            responses: Optional[dict[Union[int, str], dict[str, Any]]] = None,
            deprecated: Optional[bool] = None,
            name: Optional[str] = None,
            methods: Optional[Union[set[str], list[str]]] = None,
            operation_id: Optional[str] = None,
    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_response_model_as_return_annotation.py

                        },
                    }
                },
                "/no_response_model-no_annotation-return_dict": {
                    "get": {
                        "summary": "No Response Model No Annotation Return Dict",
                        "operationId": "no_response_model_no_annotation_return_dict_no_response_model_no_annotation_return_dict_get",
                        "responses": {
                            "200": {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 47.7K bytes
    - Viewed (0)
Back to top