Skip to content

Lazy Initialisation breaks WebFlux support #562

Closed
@jonathannaguin

Description

@jonathannaguin

Describe the bug

  • If the application has spring.application.main.lazy-initialization set to true, then it seems the lib drops support for webFlux responses, Mono or Flux.

To Reproduce
Steps to reproduce the behavior:

  • What version of spring-boot you are using? Using Spring Boot 2.2.6.RELEASE.
  • What modules and versions of springdoc-openapi are you using? org.springdoc:springdoc-openapi-webflux-ui:1.3.2
  • What is the actual and the expected result using OpenAPI Description (yml or json)? To support Flux or Mono responses.
  • Provide with a sample code (HelloController) or Test that reproduces the problem. A simple controller code like this:
	@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "get All Tweets") })
	@GetMapping("/tweets")
	public Flux<TweetDTO> getAllTweets() {
		Flux<Tweet> tweet = tweetRepository.findAll();
		return tweetMapper.toDTO(tweet);
	}

Expected behavior

  • A clear and concise description of what you expected to happen. Regardless of the lazy initialisation setting, the library should behave the same way.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
I tried to debug why this wasn't working and I realized the class WebFluxSupportConverter is not getting invoked at all when the Swagger documentation data gets generated. The bean is created but never invoked.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions