Skip to content

WebFlux handlers using kotlin coroutines do not produce response documentation #351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jnfeinstein opened this issue Jan 16, 2020 · 8 comments
Labels
bug Something isn't working

Comments

@jnfeinstein
Copy link

I've created a demo application here.

I believe the issue is related to this line. The return type for the mono implementation is reactor.core.publisher.Mono<com.example.demo.SystemStatusResponse> whereas the return type for the coroutine implementation is class java.lang.Object. It appears that the correct response type is locked away somewhere in the parameters: kotlin.coroutines.Continuation<? super com.example.demo.SystemStatusResponse> continuation.

@jnfeinstein jnfeinstein changed the title WebFlux handlers using Kotlin coroutines do not produce response documentation WebFlux handlers using kotlin coroutines do not produce response documentation Jan 16, 2020
@jnfeinstein
Copy link
Author

@joaodias14 JFYI...

@joaodias14
Copy link
Contributor

Hi @jnfeinstein, honestly we never noticed that until now :D.
It seems there is an issue out there.

joaodias14 pushed a commit to joaodias14/springdoc-openapi that referenced this issue Jan 20, 2020
@joaodias14
Copy link
Contributor

Hi @jnfeinstein, I opened a PR to fix the issue. If you will, take a look and suggest any change you find relevant. Thanks!

@bnasslahsen
Copy link
Collaborator

Thank you @joaodias14 for your help.
The fix will be available in the next release v1.2.27.

@jnfeinstein
Copy link
Author

jnfeinstein commented Jan 21, 2020

We're loading 1.2.27 now! Thank you @joaodias14 and @bnasslahsen.

@neonomaly
Copy link

Guys, hi!

I'am using springdoc-openapi-webflux-ui:1.2.30 lib and still have an issue:

@RestController
@RequestMapping("/v1")
class V1Controller {
  
  @GetMapping("/smth", produces = [MediaType.APPLICATION_JSON_VALUE])
  suspend fun getSmth(): List<Some> {
     return listOf(Some(), Some())
  }
}

and still has a required parameter $completion of request and ContinuationObject and CoroutineContext in schema section.

P.S. I'am using GroupedOpenAPI

@jnfeinstein
Copy link
Author

@neonomaly do you have the kotlin extension installed?

@neonomaly
Copy link

@neonomaly do you have the kotlin extension installed?

With springdoc-openapi-kotlin everything ok. Thank you!

@bnasslahsen bnasslahsen added the bug Something isn't working label Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants