WebFlux functional DSL does not recognise query parameters
See original GitHub issueThis route from the WebFlux functional demo https://github.com/springdoc/springdoc-openapi-demos/blob/ff9b81f88ce1c66ffb5bf70d9bbbd69f5d77aed6/springdoc-openapi-spring-boot-2-webflux-functional/src/main/java/org/springdoc/demo/app4/user/RoutingConfiguration.java#L21 has 2 issues:
user
parameter is documented as type “string” but it should be aUser
object. But this can be fixed by acceptingUser
instead ofMono<User>
, so it’s not the fault of springdoc.- If I change the
id
parameter fromPATH
toQUERY
then it is documented as a single body schema that containsid
field anduser
field. But I wantid
to be a query parameter anduser
to be in the request body.@RequestBody
onuser
is ignored.

also, maven project doesn’t seem to include -parameters
compiler flag, so the real parameter names aren’t seen by reflection
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Spring Boot Webflux: RouterFunctions Add Query Parameters
There is a queryParam() method on the RequestPredicates class you can use. RouterFunctions.route() .GET("/one", RequestPredicates.
Read more >Web on Reactive Stack - Spring
Both Spring MVC and WebFlux controllers support reactive (Reactor and RxJava) return types, and, as a result, it is not easy to tell...
Read more >Non-blocking with Spring WebFlux, Kotlin and Coroutines
In this article, we will develop a simple RESTful API using Spring WebFlux and aim to leverage the special Kotlin extensions in Spring....
Read more >[Solved]-Spring And Kotlin Query-Springboot - appsloveworld
Coding example for the question Spring And Kotlin Query-Springboot. ... This is possible because the Order is appended to the given query string....
Read more >springdoc-openapi v2.0.0
Spring-webflux/WebMvc.fn with Functional Endpoints. Since version v1.5.0, a functional DSL has been introduced, thanks to this enhancement ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Sam-Kruglov,
I see what you want now.
If you just respect the contribution guide, you will make your requests easier for you and for us.
This is what is already written: If you are reporting a bug, please help to speed up problem diagnosis by providing as much information as possible:
Please make sure you respect this guidelines if you open any new issue.
Similar issue is still present for me. I will open another issue if I have time. But basically, if I specify
beanClass
andmethodName
, and there I have parametersMyDto, String, String
and the operation is notGET
, then the resulting spec will have a request body with all these parameters as a single object similar to what we have here on the screenshot.I say that any request body that does not set
$ref
to/components/schema
is wrong.If I specify
@RequestBody MyDto, @Parameter String, @Parameter String
then nothing changes. I have to explicitly say@RequestBody MyDto, @Parameter(in=QUERY) String, @Parameter(in=QUERY) String
for it to change as I want.I think it is a reasonable default to assume the dto is in the body and any literals is a query parameter unless specified otherwise. Always building a composite request body seems a very strange approach. I saw there a condition to always create a request body if the HTTP method is anything except GET (see the only usage of
org.springdoc.core.RequestBodyService#calculateRequestBodyInfo
). I might not have any body in POST request. Hopefully that helps.upd: current workaround: