-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 not JAX-RS parameters within resource methods #40031
Allow not JAX-RS parameters within resource methods #40031
Conversation
Thanks for your pull request! The title of your pull request does not follow our editorial rules. Could you have a look?
This message is automatically generated by a bot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution, let's wait @geoand feedback.
|
||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target(ElementType.TYPE) | ||
public @interface RestEasyParamsFilter { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will defer to @geoand on this PR but my guess is that we need a better name without RestEasy
in it.
I need to think about this because I'm not a fan of running the predicate at build time |
If it not feasible having predicate at build time (why? Just to be aligned to on design decision), I could provide an alternative implementation. As we said, it is a draft of PR to provide solution for the use case |
The reason is that user code is almost never run during build time |
7cc8eda
to
06081cc
Compare
Wondering about your doubts, I have push forced a new solution to achieve same behavior. Now if it is enabled a skipAllNotMethodParameter configuration, the endpoint indexer set as SKIPPED every params that is NOT a JAX-RS params. |
0a23854
to
60fcd08
Compare
Seems more reasonable now, thanks. Is there any chance you can add some sort of test for this? |
Yes, I'm going to add tests |
I have just added tests. Moreover, I have done a small refinement about configuration definition: wondering about design of this feature, I guess "skip" is not totally correct in prospective of developer who use the configuration, in fact he could be unaware about how indexing of params is done (and implementation strategy of deployment in general). So the term "skip" is used within the implementation and the configuration is now: |
Thanks for this. Now that I think of it more, I don't believe that a config property is the right way to go for this, because no application would ever set it. |
I didn't think to this, but it is more feasible actually. I'll try to write down something in this direction |
Just committed build item approach. If there is a better package to store new item let me know. Moreover, I have some doubts about if I should edit an existing item or defining a fine-grained item as I have done |
.../src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveProcessor.java
Outdated
Show resolved
Hide resolved
Seems reasonable! Can you please squash the commits? |
133fde4
to
3b82d19
Compare
Squashed commits, I have run formatter plugin too |
|
||
import io.quarkus.builder.item.SimpleBuildItem; | ||
|
||
public final class AllowNotRestParametersBuildItem extends SimpleBuildItem { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little Javadoc on what this done would be great
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
3b82d19
to
c14cf3f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Status for workflow
|
🎊 PR Preview ca27e0c has been successfully built and deployed to https://quarkus-pr-main-40031-preview.surge.sh/version/main/guides/
|
This comment has been minimized.
This comment has been minimized.
Status for workflow
|
This allows to ignore params that are not related to JAX-RS fields, marking them as SKIPPED in order to use different annotated params with respect JAX-RS api in same method. This feature can be used by extension that generate a dedicate build item to init skipping feature