Can't disable derive_filter? in json API
I have this json API definition in my domain
And on the resource I have this
Yet when I go to my open api page I still see input field for the filter.
10 Replies
I found this issue, but I don't know how to solve it https://github.com/ash-project/ash_json_api/issues/193
GitHub
derive_filter? false
does not appear to do anything at the resour...The docs say this should be supported at the resource level, but after adding it to my json_api block: json_api do type "artist" includes [:albums] derive_filter? false end I still have f...
that's for config at the resource level, not on the individual route
I forgot to mention I've also tried putting
derive_filter? false
on the resource, just below the type
line in my above example, but it doesn't change anything🤔
what version of ash_json_api are you using?
1.4.36
FYI I think the same issue happens with
Ignore that I was thinking of something else. I was thinking of the
derive_sort?
regardless where I put itincludes
parameter in open API
Not sure if it's related, but this get route I've defined goes to a custom action instead of a read action. I switched from get
to route
which implicitly removed the parameters for filtering and including relationships. However, they're both still present on the patch route which goes to the normal default update action...
In this version of ash_json_api, the function that creates this parameter is in deps/ash_json_api/lib/ash_json_api/json_schema/open_api.ex
line 1631. I may be misunderstanding something, but I don't see anything checking the derive_filter? option around this function.🤔 there is a
filter
option on patch
routes?Maybe this was never meant to be configurable and I was just confusing the parameter
Limits the response fields to only those listed for each type
with the option for filtering?🤔
I think there are a few different things that are being talked about here and I've kind of lost the thread
Yeah I was talking about the automatically generated parameter for limiting which fields of your resource are returned. And I was confusing it with the configurable parameter for filtering based on values. Basically the former generates the SELECT statement and the latter generates the WHERE statement.
I think it's not possible to disable the SELECT one
So, sorry for the confusion 😅
Correct, you can't disable
fields
its part of the spec
but we could make it a thing