ja_serializer icon indicating copy to clipboard operation
ja_serializer copied to clipboard

sparse fields option is formatted exactly opposite of what is received by the controller

Open doughsay opened this issue 7 years ago • 0 comments

Using the default dasherized fields, here's an example:

GET "/admin-users?fields[admin-user]=first-name,last-name"

params["fields"] == %{"admin_user" => "first-name,last-name"}

Note: the resource name was underscored, and the field names were left untouched. This I assume is being done by the Deserialize plug.

But the call to render needs exactly the opposite formatting, i.e. it expects: %{"admin-user" => "first_name,last_name"} with the resource name still dasherized and the field names underscored.

doughsay avatar Mar 27 '18 16:03 doughsay