8000 Fix text regarding serializer error messages. · dhepper/django-rest-framework@e80d3d1 · GitHub
[go: up one dir, main page]

Skip to content

Commit e80d3d1

Browse files
committed
Fix text regarding serializer error messages.
Closes encode#734.
1 parent 22a389d commit e80d3d1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/api-guide/serializers.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,10 @@ To serialize a queryset instead of an object instance, you should pass the `many
9191

9292
## Validation
9393

94-
When deserializing data, you always need to call `is_valid()` before attempting to access the deserialized object. If any validation errors occur, the `.errors` and `.non_field_errors` properties will contain the resulting error messages.
94+
When deserializing data, you always need to call `is_valid()` before attempting to access the deserialized object. If any validation errors occur, the `.errors` property will contain a dictionary representing the resulting error messages.
95+
Each key in the dictionary will be the field name, and the values will be lists of strings of any error messages corresponding to that field. The `non_field_errors` key may also be present, and will list any general validation errors.
9596

96-
When deserialising a list of items, errors will be returned as a list of tuples. The first item in an error tuple will be the index of the item with the error in the original data; The second item in the tuple will be a dict with the individual errors for that item.
97+
When deserializing a list of items, errors will be returned as a list of dictionaries representing each of the deserialized items.
9798

9899
### Field-level validation
99100

0 commit comments

Comments
 (0)
0