You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My application has an API endpoint that accepts a dynamic form post (we don't know the fields of the form ahead of time). The endpoint is looking for a POST with a request body of MultiValueMap<String, String>. This works well in my application but the Swagger API displays with two fields, "all" and "empty"; when the "all" field is filled in the data doesn't make it to the actual endpoint.
To Reproduce
I'm on the newest version of Spring Boot and the library. My controller methods looks like this...
That @RequestBody mapping is from the org.springframework.web.bind.annotation package, which I believe is correct.
Screenshots
When I visit the Swagger documentation page, the endpoint's API documentation is rendered like so:
Additional context
My expectation is that there's one text area where I could paste URL encoded parameters, delineated with an ampersand. When I press the "Execute" button I'd like it to generate a cURL command that looks like this...
There could be something obvious I'm missing but I have spent a good amount of time trying to make this work and I am stumped. Any help would be greatly appreciated.
Thank you!
The text was updated successfully, but these errors were encountered:
cmiles74
changed the title
API Endpoint that Accepts Form Data as MultiValueMap Renders as Fields in Swagger UI
API Endpoint that Accepts Form Data as MultiValueMap Renders as Multiple Fields in Swagger UI
Feb 20, 2025
Describe the bug
My application has an API endpoint that accepts a dynamic form post (we don't know the fields of the form ahead of time). The endpoint is looking for a POST with a request body of
MultiValueMap<String, String>
. This works well in my application but the Swagger API displays with two fields, "all" and "empty"; when the "all" field is filled in the data doesn't make it to the actual endpoint.To Reproduce
I'm on the newest version of Spring Boot and the library. My controller methods looks like this...
That
@RequestBody
mapping is from theorg.springframework.web.bind.annotation
package, which I believe is correct.Screenshots
When I visit the Swagger documentation page, the endpoint's API documentation is rendered like so:
Additional context
My expectation is that there's one text area where I could paste URL encoded parameters, delineated with an ampersand. When I press the "Execute" button I'd like it to generate a cURL command that looks like this...
There could be something obvious I'm missing but I have spent a good amount of time trying to make this work and I am stumped. Any help would be greatly appreciated.
Thank you!
The text was updated successfully, but these errors were encountered: