FastAPI · Function
jsonable_encoder
jsonable_encoder converts objects such as Pydantic models and datetimes into ordinary Python data that JSON can encode. It returns a dictionary, list, or scalar values, not a JSON string.
Last updated
Syntax
jsonable_encoder(obj, include=None, exclude=None, by_alias=True, exclude_unset=False, exclude_defaults=False, exclude_none=False, custom_encoder=None, sqlalchemy_safe=True)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
FastAPIPydanticJSONResponseresponse_model