Closed thejohnnybot closed 5 months ago
So, I've made some changes in main
that should address this better. What you will probably want to do is first begin by using the new top level default fields option
json_api do
default_fields [:currency, :identifier, :current_balance]
end
As that will alter the root object type definition for the resource. With the changes I've made, if you use the route-specific default_fields
option, we no longer make a reference to the root type, as the route produces a type different from the default type.
If you can, please try main and let me know how it goes.
Hi @zachdaniel I tested the changes and updated the code to follow your approach, it did not correct the issue and now it also modified the open_api filters so now it thinks strings are object searches.
Well, the strings are object searches. You'd do filter[name][eq]=value
. Although I guess it could be a string or an object, as filter[name]=value
It must have changed something right? Did you move the default_fields
to the resource level?
@zachdaniel yes I moved the fields to the resource level but the swaggerui did not show the updated changes. Also when I was mentioning the other thing. the swaggerui did correctly pick up the string attribute but now it wont let me run a test with the same payload on the ui saying I am doing a invalid filter
What I changed about it is that it should show all fields, with a comment in the description about the fields that are included by default. Since technically every key can be omitted with the fields
option. Are you seeing the extra fields as not showing up?
Okay, the filter thing should be fixed in main
now.
To Reproduce
Expected behavior fields section should be updated to include new fields
** Runtime