BaseSchema.dumps¶
- BaseSchema.dumps(obj, *args, many=None, **kwargs)¶
Same as
dump()
, except return a JSON-encoded string.- Parameters
obj (
Any
) – The object to serialize.many (
Optional
[bool
]) – Whether to serialize obj as a collection. If None, the value for self.many is used.
- Returns
A
json
string
New in version 1.0.0.
Changed in version 3.0.0b7: This method returns the serialized data rather than a
(data, errors)
duple. AValidationError
is raised ifobj
is invalid.