Closed sevenseacat closed 5 months ago
I just pushed up a fix for this in response to https://github.com/ash-project/ash_json_api/issues/194 can you see if that fixes this for you as well please?
I've got a test reproducing that other issue, but it doesn't behave the same way as this one does, let me try with an aggregate instead of a calc, perhaps its a difference in our serialization.
Okay, yeah so without that previous fix, it looks like we get the error you're describing. So that last fix fixed both, will ensure both are covered in the test I'm writing :)
Yep, works 👍 I thought it would be pretty similar to that issue but different enough to warrant its own mention.
Describe the bug
When including an aggregate into the list of defined fields at the resource level, eg.
Attempting to access an API endpoint for the resource generates an error because the aggregate is not loaded:
This works if the
default_fields
is specified at the route level, just not at the resource level.Expected behavior
The API response should not error and should include the
album_count
aggregate in the response.Runtime