jsonapi-rb / jsonapi-rails

Rails gem for fast jsonapi-compliant APIs.
http://jsonapi-rb.org
MIT License
319 stars 63 forks source link

no json/jsonb support? #84

Closed jerrygreen closed 5 years ago

jerrygreen commented 6 years ago

For render method I can use something like this (example from official doc):

           fields: { users: [:name, :email], posts: [:title, :content] }

But I can't use this, right?

           fields: { users: [:name, :email], posts: [:title, :content, data: [:additional_info, :some_key]] }

Why? I want that filtering for json/jsonb columns ;(

beauby commented 5 years ago

A bit late but: the reason is simply that the json:api spec does not allow the above to be expressed via the fields query parameter. You could do multiple serializers.