Skip to content
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

OpenAPI Generator Return type Improvements #1098

Merged
merged 2 commits into from
Jul 5, 2023

Conversation

andriy-dmytruk
Copy link
Contributor

Improvements for the operation return type:

  • HttpResponse can be generated only where required (a response header is used or status code other than 200)
  • Flux is returned for iterable types instead of Mono<List<>> when using reactive return types

- Add an option to generate HttpResponse only where it is required
- Use Flux for list return types when reactive = true
@graemerocher
Copy link
Contributor

there are failing tests

@graemerocher
Copy link
Contributor

Flux might be worse for performance /cc @dstepanov

@dstepanov
Copy link
Contributor

Flux or publisher response is always streaming the content. In my benchmarking Flux is much slower than Mono<List>

If you have a single response use Mono, or @SingleResult Publisher / Flux. For returning a list of values is always better to use collectList and Mono

@sonarcloud
Copy link

sonarcloud bot commented Jul 4, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

0.0% 0.0% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@graemerocher graemerocher merged commit 2dc67e7 into master Jul 5, 2023
6 of 7 checks passed
@graemerocher graemerocher deleted the andriy/generator-return-types-improve branch July 5, 2023 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants