vt-elixir / ja_serializer

JSONAPI.org Serialization in Elixir.
Other
640 stars 148 forks source link

Fix relationship key formatting for multiword relationship names #255

Closed jerel closed 7 years ago

jerel commented 7 years ago

Currently any multi-word relationship names will end up formatted as user-account_id so this PR builds the id and then formats it.

beerlington commented 7 years ago

@jerel I haven't run into this issue before and use multi word relationships quite a bit. Any chance you're overriding the default key format? https://github.com/vt-elixir/ja_serializer#key-format-for-attribute-relationship-and-query-param

jerel commented 7 years ago

You're right. I was using JaSerializer.Params.to_attributes/1 in a channel and the unexpected behavior was because the JaSerializer.ParamParser.parse/1 plug was not in play. I combined parse/1 and to_attributes/1 into a custom to_attributes/1 and it works without my "fix".

By the way, is another Hex release likely to happen soon? We've been running off of a git hash because the last release was in February

beerlington commented 7 years ago

@jerel I'm hoping to get a new release out in the next couple weeks. Stay tuned!