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
{{ message }}
Repository navigation
aliased attribute name will produce incorrect errors #104
The error pointer do not match the alias used in the serializer.
serializer :
attribute :reply do
@object.content
end
response when there is an active record error :
{"errors":[{"title":"Invalid content","detail":"Nouveau commentaire est trop court (au moins 16 caractères)","source":{}}],"jsonapi":{"version":"1.0"}}
Ideally source should contain a pointer to reply.
I am not sure If it is possible to correctly alias the error with the declaration done in a bloc.
The errors are set by the deserializer, which are independent from the serializers. The deserializable module maintains a reverse mapping for renamed keys, which is used to generate the JSON pointer.
Activity
beauby commentedon Mar 8, 2019
The errors are set by the deserializer, which are independent from the serializers. The
deserializablemodule maintains a reverse mapping for renamed keys, which is used to generate the JSON pointer.