When attempting to include a relationship that is not marked public? true, a confusing error message is returned. May be tangentially related to #10 .
To Reproduce
The resource:
Tunez.Music.Artist:
json_api do
type "artist"
includes [:albums]
routes do
base "/artists"
get :read
end
end
relationships do
has_many :albums, Tunez.Music.Album do
# public? true
end
end
Describe the bug
When attempting to include a relationship that is not marked
public? true
, a confusing error message is returned. May be tangentially related to #10 .To Reproduce
The resource:
Tunez.Music.Artist
:The request:
http://localhost:4000/api/artists/4fad50ae-9f07-49c1-a04a-560477a5d47d?include=albums
The error:
If uncommenting the
public? true
line on the relationship, the request works as expected.Expected behavior
A properly formatted JSON response to the user that they've requested something invalid.
I wonder if we could also make it a compilation error for the developer - you can't include something that isn't public?
Runtime