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
When using JSON-API with polymorphic associations there is a strange behavior, instead of using the name of the resource it chooses to use the name assigned to the polymorphic relation.
Realize this is closed, but I am fighting a similar issue around the naming of polymorphic associations. No offense @joaomdmoura, but I feel the way the json-api is set up is correct. There may be multiple of those polymorphs, so nesting them under 'addressable' and then defining what type it is gives the flexibility needed.
It appears that this behavior stopped happening for the JSON adapter circa rc3 #1420 (comment)
And, again, I feel this is limited ... I also have a issue open around this demonstrating more #1717
When using JSON-API with polymorphic associations there is a strange behavior, instead of using the name of the resource it chooses to use the name assigned to the polymorphic relation.
This is not
wrong
©️, but if you think about the most of JS clients frameworks around, it makes more sense to use the resource's name.Here is as example to illustrate:
model/address.rb
model/user.rb
The serialized JSON output for address will be:
My point is related to this part:
Despite of being a user the root name of this node is
addressable
, and IMO it should beuser
.The text was updated successfully, but these errors were encountered: