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

Complete OpenAPI for PanacheEntityResource #28786

Closed
gmuellerinform opened this issue Oct 24, 2022 · 5 comments · Fixed by #28811
Closed

Complete OpenAPI for PanacheEntityResource #28786

gmuellerinform opened this issue Oct 24, 2022 · 5 comments · Fixed by #28811

Comments

@gmuellerinform
Copy link
Contributor

gmuellerinform commented Oct 24, 2022

Description

PanacheEntityResource is using Resource as return value and therefore the OpenAPI is not picking up the correct return type. It would be great if this could be fixed. Including the correct return types for errors.

Thank you!

Implementation ideas

No response

@quarkus-bot
Copy link

quarkus-bot bot commented Oct 24, 2022

@geoand
Copy link
Contributor

geoand commented Oct 24, 2022

cc @Sgitario

@Sgitario
Copy link
Contributor

I think that this was already done in #26074. Are you using the Quarkus Smallrye OpenApi extension?

@gmuellerinform
Copy link
Contributor Author

gmuellerinform commented Oct 24, 2022

Yes, I am. This is how it looks:

image

and this how it should look like, using the code:

public List<ApplicationRole> list(@PathParam("user_id") Long user_id) {

image

It is a nice to have feature, not too high a priority. Thanks!

@Sgitario
Copy link
Contributor

Oh, I see what is going on. This works for the reactive version of REST Data Panache because Uni is generic, but not for the classic one because Response is not a generic type.
I will address this issue asap. Thanks for reporting!

Sgitario added a commit to Sgitario/quarkus that referenced this issue Oct 25, 2022
Before these changes, Open API could not deduct the return type when using Response.class (in Rest Data Panache classic). 
Also, for Rest Data Panache reactive, the return object for the endpoint '/get' was wrongly saying that was a single entity when is an array of entities. 
And finally, for the update and delete endpoints, the result status code was wrong (for update should be 201 and for delete 204).
After these changes, all the above issues are fixed and covered using the existing test.
Fix quarkusio#28786
@quarkus-bot quarkus-bot bot added this to the 2.14 - main milestone Oct 25, 2022
tmihalac pushed a commit to tmihalac/quarkus that referenced this issue Oct 27, 2022
Before these changes, Open API could not deduct the return type when using Response.class (in Rest Data Panache classic). 
Also, for Rest Data Panache reactive, the return object for the endpoint '/get' was wrongly saying that was a single entity when is an array of entities. 
And finally, for the update and delete endpoints, the result status code was wrong (for update should be 201 and for delete 204).
After these changes, all the above issues are fixed and covered using the existing test.
Fix quarkusio#28786
@gsmet gsmet modified the milestones: 2.14.0.CR1, 2.13.6.Final Dec 14, 2022
gsmet pushed a commit to gsmet/quarkus that referenced this issue Dec 14, 2022
Before these changes, Open API could not deduct the return type when using Response.class (in Rest Data Panache classic).
Also, for Rest Data Panache reactive, the return object for the endpoint '/get' was wrongly saying that was a single entity when is an array of entities.
And finally, for the update and delete endpoints, the result status code was wrong (for update should be 201 and for delete 204).
After these changes, all the above issues are fixed and covered using the existing test.
Fix quarkusio#28786

(cherry picked from commit cb8bffb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants