You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/general/serializers.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -217,7 +217,17 @@ The object being serialized.
217
217
218
218
#### #root
219
219
220
-
PR please :)
220
+
Resource root which is included in `JSON` adapter. As you can see at [Adapters Document](adapters.md), `Attribute` adapter (default) and `JSON API` adapter does not include root at top level.
221
+
By default, the resource root comes from the `model_name` of the serialized object's class.
222
+
223
+
There are several ways to specify root:
224
+
*[Overriding the root key](rendering.md#overriding-the-root-key)
225
+
*[Setting `type`](serializers.md#type)
226
+
* Specifying the `root` option, e.g. `root: 'specific_name'`, during the serializer's initialization:
0 commit comments