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

Allow use of abstract classes in Quarkus REST in the same way as interfaces #41606

Merged
merged 1 commit into from
Jul 3, 2024

Conversation

geoand
Copy link
Contributor

@geoand geoand commented Jul 2, 2024

@geoand
Copy link
Contributor Author

geoand commented Jul 2, 2024

@michalvavrik would you like to test this and see if it fixes the various use cases you had in mind?

It does fix the one you linked you, but IIUC you had more.

@michalvavrik
Copy link
Member

@michalvavrik would you like to test this and see if it fixes the various use cases you had in mind?

It does fix the one you linked you, but IIUC you had more.

I would. I'll be back in 2 hours and test it. Thanks for the fix.

@geoand
Copy link
Contributor Author

geoand commented Jul 2, 2024

Thanks! No rush whatsoever

Copy link
Member

@michalvavrik michalvavrik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed all my issues, thanks!

BTW. tests that are fixed by this will be part of my next PR for endpoint. impl. security checks in Quarkus REST

@geoand
Copy link
Contributor Author

geoand commented Jul 2, 2024

Excellent, thanks!

@geoand geoand marked this pull request as ready for review July 2, 2024 17:52

This comment has been minimized.

@geoand geoand requested a review from gastaldi July 3, 2024 05:43
@gastaldi
Copy link
Contributor

gastaldi commented Jul 3, 2024

Shall we backport this fix too?

// handle abstract classes
Set<ClassInfo> abstractScannedResources = scannedResources.values().stream().filter(ClassInfo::isAbstract)
.collect(Collectors.toSet());
for (ClassInfo abstractScannedResource : abstractScannedResources) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe avoid the extra iteration above and call isAbstract here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you are referring to here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are creating a Set above just to iterate again in this loop, I am suggesting merging both loops to a single one

@geoand
Copy link
Contributor Author

geoand commented Jul 3, 2024

Shall we backport this fix too?

sure yeah

rsvoboda added a commit to rsvoboda/quarkus-test-suite that referenced this pull request Sep 3, 2024
rsvoboda added a commit to rsvoboda/quarkus-test-suite that referenced this pull request Sep 3, 2024
michalvavrik pushed a commit to michalvavrik/quarkus-test-suite that referenced this pull request Sep 7, 2024
michalvavrik pushed a commit to michalvavrik/quarkus-test-suite that referenced this pull request Sep 7, 2024
michalvavrik pushed a commit to michalvavrik/quarkus-test-suite that referenced this pull request Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Quarkus REST abstract resources with @Path requires impl. to be CDI beans while RESTEasy does not
4 participants