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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The reason will be displayed to describe this comment to others. Learn more.
Just saw it today, sorry for taking so long ppl.
So, @bolshakov, on your example you simulated a best case scenario, but there are ppl using different serializers to serialize the same kind of object, in this case you would have different roots, which is kind of inconsistent, so after discussing with part o Rails team we decided to go for it.
We will still work on this in order to make it compatible with multiple conventions, it's already part of a PR.
I'm not saying we will keep it this way, we are always open to discuss it 😄
4187213
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain this change.
Before this change we used
Serializer.root_name
asjson_key
. Root name defined as follows:So for
TestMovie
andTestMovieSerializer
:What is the aim of both methods?
4187213
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It also strangely behaves with namespaces models:
4187213
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joaomdmoura Why this commit was necessary?
4187213
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joaomdmoura +1 for the questions.
Not sure there are other places where
Serializer.root_name
used right now.4187213
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just saw it today, sorry for taking so long ppl.
So, @bolshakov, on your example you simulated a best case scenario, but there are ppl using different serializers to serialize the same kind of
object
, in this case you would have different roots, which is kind of inconsistent, so after discussing with part o Rails team we decided to go for it.We will still work on this in order to make it compatible with multiple conventions, it's already part of a PR.
I'm not saying we will keep it this way, we are always open to discuss it 😄