mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 06:16:50 +00:00
Updating the meta key documentation to warn users that { root: false } will cause the serializer to ignore the meta key as it leads to invalid JSON.
https://github.com/rails-api/active_model_serializers/issues/332
This commit is contained in:
parent
4f185efa90
commit
b20ad33407
@ -351,6 +351,9 @@ The above usage of `:meta_key` will produce the following:
|
||||
}
|
||||
```
|
||||
|
||||
When using meta information, your serializer cannot have the `{ root: false }` option, as this would lead to
|
||||
invalid JSON. If you do not have a root key, the meta information will be ignored.
|
||||
|
||||
If you would like direct, low-level control of attribute serialization, you can
|
||||
completely override the `attributes` method to return the hash you need:
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user