-
Notifications
You must be signed in to change notification settings - Fork 9
Support endpoint with different responses for different status codes #328
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
Comments
BTW: OpenApiTools/openapi-generator handles this by using |
yes, that is not so nice. Returning I played around a bit with The idea behind this option was to use the success response type and ignore the error responses (which can throw). With This helps in this case too as long as any error response is described.... Unfortunately
The fallback workaround is to It is still generating an interface
|
fixed in 2025.2, it can also generate marker interfaces for the result object if enabled. Thanks for reporting! |
This is from a large public sector project where we implement an api.
The open api yaml specifies different response types for response status 200 and 202 (either a search result or a notification that result is not yet available).
When generating rest controller interface for Spring, the openapi-processior blindly uses the model class for the 202 response.
I managed to get it somehow working by configuring the endpoint to use
ResponseEntity
as return type, but that needs a pretty hacky workaround:I created a small example project, see https://github.com/eekboom/openapi-processor-example
The text was updated successfully, but these errors were encountered: