JSONAPi::Resource limiting models that can be requested in include

99 Views Asked by At

I am using the Ruby gem JSONAPI::Resources, the model has quite a few related objects, and I don't want to expose all of them to be queried though the include option in URL.

localhost:3000/api/v1/posts?include=author but since there are are comments and ratings associated models. This also works

localhost:3000/api/v1/posts?include=comments

localhost:3000/api/v1/posts?include=ratings

Which is not a desirable effect. How can it be limited.

Thank in advance.

0

There are 0 best solutions below