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

Spring ResponseEntity<T> equivalent #825

Open
ghost opened this issue Oct 18, 2024 · 3 comments
Open

Spring ResponseEntity<T> equivalent #825

ghost opened this issue Oct 18, 2024 · 3 comments

Comments

@ghost
Copy link

ghost commented Oct 18, 2024

I need the generated java code include both response body and headers.

I know there is return-response option to return javax.ws.rs.core.Response but that class is not generic and requires casting all the time.

Is there anything similar to spring ResponseEntity<T> in quarkus?

@ricardozanini
Copy link
Member

@ghost
Copy link
Author

ghost commented Oct 20, 2024

Yes. Is there any way to generate RestResponse<T> instead of javax.ws.rs.core.Response ?

@ricardozanini
Copy link
Member

No, but you can send a PR proposal extending this use case:
https://docs.quarkiverse.io/quarkus-openapi-generator/dev/client.html#returning-response-objects

So, one can have:

quarkus.openapi-generator.codegen.spec.my_openapi_yaml.return-response=RestResponse

or

quarkus.openapi-generator.codegen.spec.my_openapi_yaml.return-response=Response

But still fallback to

quarkus.openapi-generator.codegen.spec.my_openapi_yaml.return-response=true

To not break anything.

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

No branches or pull requests

1 participant