I've tested it with normal attributes, I've tested it with aggregates, nothing gets changed in the response. Maybe I'm misunderstanding how it's supposed to be used?
To Reproduce
If I define the following JSON API configuration in my resource:
json_api do
type "artist"
default_fields [:biography, :cover_image_url]
routes do
base "/artists"
get :read
end
end
In this case, biography is a non-public attribute and cover_image_url is a public aggregate.
Querying for a single record using this route returns a response with neither field in it, only the public attributes (which is what default_fields is supposed to override?)
The response should have only the fields I specify in default_fields.
(Ideally the default list would include public calculations/aggregates in the list so I don't need to specify default_fields to include them, but that's probably a separate feature request)
Describe the bug
I've tested it with normal attributes, I've tested it with aggregates, nothing gets changed in the response. Maybe I'm misunderstanding how it's supposed to be used?
To Reproduce
If I define the following JSON API configuration in my resource:
In this case,
biography
is a non-public attribute andcover_image_url
is a public aggregate.Querying for a single record using this route returns a response with neither field in it, only the public attributes (which is what
default_fields
is supposed to override?)Expected behavior
The response should have only the fields I specify in
default_fields
.(Ideally the default list would include public calculations/aggregates in the list so I don't need to specify
default_fields
to include them, but that's probably a separate feature request)** Runtime