I am developing a rails application using jsonapi-rb 0.5.0 (jsonapi-serializable 0.3.0).
In the relevant serializer I have:
belongs_to :programme
For the index method in the controller: this gives the desired behavior. For the get method I need to include the programme relationship linkage, but without populating the included array in the jsonapi response.
I've only been able to discover these two options: none of which are currently acceptable:
Using linkage always: true in the serializer: this is the only way to get the required response from my controller's get method, but this approach is unacceptable because it does the same thing in the index method
Using the include hash parameter to the call to render in my controller. This approach is unacceptable because it populates the included array with a large, safely cacheable object.
I am developing a rails application using jsonapi-rb 0.5.0 (jsonapi-serializable 0.3.0).
In the relevant serializer I have:
For the
index
method in the controller: this gives the desired behavior. For theget
method I need to include the programme relationship linkage, but without populating theincluded
array in the jsonapi response.I've only been able to discover these two options: none of which are currently acceptable:
Using
linkage always: true
in the serializer: this is the only way to get the required response from my controller'sget
method, but this approach is unacceptable because it does the same thing in theindex
methodUsing the
include
hash parameter to the call torender
in my controller. This approach is unacceptable because it populates theincluded
array with a large, safely cacheable object.