Skip to main content

dumps

Serialize data as JSON.

def dumps(
obj: Any,
**kwargs: Any
) - > string

Serialize data as JSON. If current_app is available, it will use its app.json.dumps() method, otherwise it will use json.dumps.

Parameters

NameTypeDescription
objAnyThe data object to serialize into a JSON string.
**kwargsAnyAdditional keyword arguments passed to the underlying JSON provider's dumps implementation.

Returns

TypeDescription
stringA JSON-formatted string representing the serialized object.