Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for custom_encoder (0.06 sec)

  1. fastapi/encoders.py

        [FastAPI docs for JSON Compatible Encoder](https://fastapi.tiangolo.com/tutorial/encoder/).
        """
        custom_encoder = custom_encoder or {}
        if custom_encoder:
            if type(obj) in custom_encoder:
                return custom_encoder[type(obj)](obj)
            else:
                for encoder_type, encoder_instance in custom_encoder.items():
                    if isinstance(obj, encoder_type):
                        return encoder_instance(obj)
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 10.7K bytes
    - Viewed (0)
  2. tests/test_jsonable_encoder.py

        encoded_instance = jsonable_encoder(
            instance, custom_encoder={safe_datetime: lambda o: o.strftime("%H:%M:%S")}
        )
        assert encoded_instance["dt_field"] == instance["dt_field"].strftime("%H:%M:%S")
    
        encoded_instance = jsonable_encoder(
            instance, custom_encoder={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)
  3. docs/en/docs/release-notes.md

    * Fix typos in docs. PR [734](https://github.com/tiangolo/fastapi/pull/734) by [@bundabrg](https://github.com/bundabrg).
    * Fix usage of `custom_encoder` in `jsonable_encoder`. PR [#715](https://github.com/tiangolo/fastapi/pull/715) by [@matrixise](https://github.com/matrixise).
    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