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

Add Optional BeanParam support for JAXRS2Contract #1935

Merged
merged 13 commits into from Feb 18, 2023

Conversation

JKomoroski
Copy link
Contributor

Implements a change to the JAXRS2Contract to optionally support @BeanParam parameter aggregators. It only adds support for aggregated parameters already supported by the existing JAXRS2Contract (ie not @Context or @Suspended).

fixes #1264

@JKomoroski JKomoroski force-pushed the issue/1264/jaxrs2_support_bean_param branch from bde77f8 to cd44762 Compare February 13, 2023 19:24
@JKomoroski
Copy link
Contributor Author

Rebased on latest master.

@JKomoroski
Copy link
Contributor Author

I'm not able to reproduce the build failures in circle CI on my local system.

@velo
Copy link
Member

velo commented Feb 13, 2023 via email

@JKomoroski
Copy link
Contributor Author

Did you run mvn clean install locally? It should fix code format for you

Ran the build skipping the Example Wikipedia modules which were failing on my local environment, and committed the changes. I forgot about the plugin that does that in this project.

@velo
Copy link
Member

velo commented Feb 14, 2023 via email

@JKomoroski JKomoroski requested a review from velo February 14, 2023 04:22
Copy link
Member

@velo velo left a comment

Choose a reason for hiding this comment

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

LGTM, just need to check why build failed

// parameter with unsupported jax-rs annotations should not be passed as body params.
// this will prevent interfaces from becoming unusable entirely due to single (unsupported)
// endpoints.
// https://github.com/OpenFeign/feign/issues/669
super.registerParameterAnnotation(Suspended.class, (ann, data, i) -> data.ignoreParamater(i));
super.registerParameterAnnotation(Context.class, (ann, data, i) -> data.ignoreParamater(i));
super.registerParameterAnnotation(BeanParam.class, (ann, data, i) -> data.ignoreParamater(i));
Copy link
Member

Choose a reason for hiding this comment

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

I think, before made sense to ignore any @BeanParam cause it was not implemented.

Now that you fixed that shortcoming, I think it's fine to have it enabled

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me know if you would like me to make this change or if you plan to make it

Copy link
Member

Choose a reason for hiding this comment

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

I think is a nice to have, but your call

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pushed this change. Jdk8 appears to be failing again in CI. Not able to duplicate on my local

@JKomoroski JKomoroski force-pushed the issue/1264/jaxrs2_support_bean_param branch from 28d56d5 to 9f5b484 Compare February 16, 2023 21:19

}
}


@Path("/")
Copy link
Member

Choose a reason for hiding this comment

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

Now, the compile time error moved to this line.... probably some jaxrs 1 leaking

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll have to install jdk 8 again to check for these issues

@JKomoroski
Copy link
Contributor Author

I can't explain why moving the @Path annotation was failing the build. In the interest of getting this change merged, I rolled back my test refactor after duplicating the build failure under jdk 8. I was able to build in jdk 8, jdk 11, and jdk 17.

@velo velo merged commit 4455fc2 into OpenFeign:master Feb 18, 2023
@JKomoroski JKomoroski deleted the issue/1264/jaxrs2_support_bean_param branch February 22, 2024 15:12
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

Successfully merging this pull request may close these issues.

Feign JAXRS 2 Support for @BeanParam
2 participants