Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for reserialize (0.2 sec)

  1. tests/test_serialize_response_model.py

    Sebastián Ramírez <******@****.***> 1652485102 -0500
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 4.2K bytes
    - Viewed (0)
  2. fastapi/responses.py

    
    try:
        import orjson
    except ImportError:  # pragma: nocover
        orjson = None  # type: ignore
    
    
    class UJSONResponse(JSONResponse):
        """
        JSON response using the high-performance ujson library to serialize data to JSON.
    
        Read more about it in the
        [FastAPI docs for Custom Response - HTML, Stream, File, others](https://fastapi.tiangolo.com/advanced/custom-response/).
        """
    
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Wed Oct 18 12:36:40 GMT 2023
    - 1.7K bytes
    - Viewed (0)
  3. tests/test_inherited_custom_class.py

            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():
            # Test that the fix also works for custom pydantic classes
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 3K bytes
    - Viewed (0)
  4. fastapi/_compat.py

                except ValidationError as exc:
                    return None, _regenerate_error_with_loc(
                        errors=exc.errors(include_url=False), loc_prefix=loc
                    )
    
            def serialize(
                self,
                value: Any,
                *,
                mode: Literal["json", "python"] = "json",
                include: Union[IncEx, None] = None,
                exclude: Union[IncEx, None] = None,
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 22.6K bytes
    - Viewed (0)
  5. fastapi/routing.py

            if errors:
                raise ResponseValidationError(
                    errors=_normalize_errors(errors), body=response_content
                )
    
            if hasattr(field, "serialize"):
                return field.serialize(
                    value,
                    include=include,
                    exclude=exclude,
                    by_alias=by_alias,
                    exclude_unset=exclude_unset,
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 170.1K bytes
    - Viewed (0)
  6. fastapi/applications.py

                        show it as the response (JSON Schema).
                    * Serialization: you could return an arbitrary object and the
                        `response_model` would be used to serialize that object into the
                        corresponding JSON.
                    * Filtering: the JSON sent to the client will only contain the data
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 172.2K bytes
    - Viewed (0)
  7. tests/test_serialize_response.py

    Nima Mashhadi M. Reza <******@****.***> 1596457747 +0430
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Mon Aug 03 12:29:07 GMT 2020
    - 1.4K bytes
    - Viewed (0)
  8. tests/test_serialize_response_dataclass.py

    Luis R <******@****.***> 1661522207 +0200
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Aug 26 13:56:47 GMT 2022
    - 4.9K bytes
    - Viewed (0)
  9. docs/en/docs/release-notes.md

    * Fix typo in release notes. PR [#1051](https://github.com/tiangolo/fastapi/pull/1051) by [@sattosan](https://github.com/sattosan).
    * Refactor/clarify `serialize_response` parameter name to avoid confusion. PR [#1031](https://github.com/tiangolo/fastapi/pull/1031) by [@patrickmckenna](https://github.com/patrickmckenna).
    Plain Text
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Apr 19 19:30:49 GMT 2024
    - 384.6K bytes
    - Viewed (1)
  10. tests/test_datetime_custom_encoder.py

    @needs_pydanticv2
    def test_pydanticv2():
        from pydantic import field_serializer
    
        class ModelWithDatetimeField(BaseModel):
            dt_field: datetime
    
            @field_serializer("dt_field")
            def serialize_datetime(self, dt_field: datetime):
                return dt_field.replace(microsecond=0, tzinfo=timezone.utc).isoformat()
    
        app = FastAPI()
        model = ModelWithDatetimeField(dt_field=datetime(2019, 1, 1, 8))
    
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 1.6K bytes
    - Viewed (0)
Back to top