restapi.models.schema.Schema.dumps
- Schema.dumps(obj, *args, many=None, **kwargs)[source]
Same as
dump(), except return a JSON-encoded string.- Parameters:
obj (
Any) – The object to serialize.many (
bool|None, default:None) – Whether to serialize obj as a collection. If None, the value for self.many is used.
- Returns:
A
jsonstring
Added in version 1.0.0.
Changed in version 3.0.0b7: This method returns the serialized data rather than a
(data, errors)duple. AValidationErroris raised ifobjis invalid.