Trying to do this generates a compilation error, though:
index :search do
default_fields [:cover_image_url, :latest_album_year_released, :album_count]
end
Generates:
error: function default_fields/1 imported from both AshJsonApi.Resource.JsonApi.Routes.Index.Options and
AshJsonApi.Resource.JsonApi.Options, call is ambiguous
lib/tunez/music/artist.ex:44:9
This is the only call to default_fields in the app - this is the first resource I'm setting up.
Expected behavior
The app should compile, and accessing the index route should return a JSON structure with those three fields in the response for each record.
Describe the bug According to https://hexdocs.pm/ash_json_api/dsl-ashjsonapi-resource.html#json_api-routes-index, we should be able to provide
default_fields
for individual routes, to be included in the response.Trying to do this generates a compilation error, though:
Generates:
This is the only call to
default_fields
in the app - this is the first resource I'm setting up.Expected behavior
The app should compile, and accessing the
index
route should return a JSON structure with those three fields in the response for each record.** Runtime