Replies: 3 comments 1 reply
-
|
Hey @lobernar Sorry for the late reply. I will take another look but the issue here is that it is really hard to describe query strings in OpenAPI 3.1 and the tooling does not handle it well. This is why I always wanted to make my own OpenAPI renderer that would be more tuned for common Laravel practices. Can you please share the source code you have so I can reproduce and see what is the best option? |
Beta Was this translation helpful? Give feedback.
-
|
Hey @romalytvynenko, thanks for getting back to me! Happy new year and sorry too for the late reply, I was on vacation. I’ve pushed a small repository with a minimal reproducible example that demonstrates the issue with bracketed query parameters like filter[id][_eq] in the OpenAPI / Swagger “Send API Request” feature. This example only support the _eq and _neq filters. Here is the URL: https://github.com/lobernar/laravel_scramble_filter Everything you need to run it and reproduce the problem should be explained in the README of the repo. Let me know if you need anything else or if I can simplify the example further. |
Beta Was this translation helpful? Give feedback.
-
|
Hey @romalytvynenko Just wanted to follow up and see if you’ve had a chance to take a look at the repo I shared. Happy to help in any way if you need more details, tweaks to the example, or additional test cases. Thanks again! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am trying to use custom filter queries in the following format:
/api/{resource}?filter[column][operator]=valueFor example:
/api/users?filter[id][_eq]=1This works correctly in my application and is parsed properly by the backend.
However, when I try to use the “Send API Request” feature in the generated OpenAPI/Swagger UI, I cannot construct a valid request. Instead of generating nested query parameters, the package generates a query like this:
The resulting request is sent in the following form:
To summarize
The UI does not allow entering nested query parameters like
filter[id][_eq]correctly.Using deepObject style in the OpenAPI schema does not help — the generated request is invalid or empty.
As a result, I cannot test my endpoints through the “Send API Request” feature.
Essentially, the current parameter rendering does not support the bracketed query format that my API uses.
It would be great if either:
The UI could correctly handle
filter[column][operator]style query parameters, orThere was guidance for documenting and testing such custom filters in OpenAPI/Swagger UI.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions