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 BeanParam support in Jersey 2 client #3493

Closed
jerseyrobot opened this issue Jan 13, 2017 · 15 comments
Closed

Add BeanParam support in Jersey 2 client #3493

jerseyrobot opened this issue Jan 13, 2017 · 15 comments

Comments

@jerseyrobot
Copy link
Contributor

Affected Versions

[2.25]

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
Reported by rachana.kumari

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
@pavelbucek said:
Please add code samples or some description about what the feature should provide (feel free to use paragraph below to have something to start with). Failing you to do so will result in closing this report as incomplete.

It makes natural sense to have this supported on the server side - you can inject Query/Path/Form/... params and other, runtime related obects. Most of them are not available on client side, because they simply don't exists in that scope. Also, how would that be accessed by the user? (Client is "a builder which returns a Response.. how would you get the instance of the annotated object? There is no "client resource" .. ).

Thanks and regards,
Pavel

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
rachana.kumari said:
I have business scenarios where I am fetching four query params and one path param combined into BeanParam from swagger in one of java component. Now, this component will pass same (four query param and one Path Param) ahead to other component using jersey client api. Now, my first component is client invoking call to other component. Client invocation is not supporting BeanParam while I am able to accep BeanParam at server end. My first component has to ipass each queryparam and path param separately as argument to client method which nvokes server rest method.

I have analysed jersey client code and I found issue. Please find code impact of jersey client to support BeanParam :-

  1. WebResourceFactory : invoke method
  2. WebresourceFactory : hasAnyParamAnnotation

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
alex-shpak said:
There is related pull request
https://github.com/jersey/jersey/pull/235

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
This issue was imported from java.net JIRA JERSEY-3221

@jerseyrobot
Copy link
Contributor Author

@andrei-ivanov
Copy link

Any chance to get the PR reviewed and merged? 😕

@senivam
Copy link
Contributor

senivam commented May 9, 2019

In order for this ( 235 ) PR to be reviewed some enthusiast shall re-publish it here (to new Jersey) with valid ECA signed. Afterwards it will be reviewed.

@jansupol
Copy link
Contributor

jansupol commented May 9, 2019

The bean params are supported by the MP Rest Client which has similar functionality as the proxy client. The #4086 is using BeanParams. Would it help?

@andrei-ivanov
Copy link

@lucastsa any chance you would re-publish your PR here?

@jansupol not sure, in theory there's a single place where we create these client proxies, so the changes should be minimal, but I would also have to check if the MP Rest Client requires any other changes (we use the JAX-RS / Jersey / Spring / Spring Boot stack). One other thing is that #4086 seems yet to be merged, so I can't actually test.

@derekm
Copy link

derekm commented Oct 11, 2019

@jansupol -- WebResourceFactory is still better, more mature, more battle-tested than MP Rest Client in several respects, despite missing BeanParams and ParamConverterProviders, etc.

For example, eclipse/microprofile-rest-client#217

It would be a good idea to continue to maintain WebResourceFactory & have WRF & MP Rest Client use the same backend abstractions/proxies. I'd like to see MP Rest Client move away from the fat, clunky RestClientBuilder API and towards the leaner, more advanced WRF API...

robersheimer added a commit to robersheimer/jersey that referenced this issue Nov 26, 2021
Allows the proxy client holding a resource interface to supply
a bean of the corresponding type for the method fields annotated
with @BeanParam, instead of having to supply the associated
parameters individually. This also works if BeanParams themselves
contain fields annotated with @BeanParam.
robersheimer added a commit to robersheimer/jersey that referenced this issue Nov 26, 2021
Allows the proxy client holding a resource interface to supply
a bean of the corresponding type for the method fields annotated
with @BeanParam, instead of having to supply the associated
parameters individually. This also works if BeanParams themselves
contain fields annotated with @BeanParam.
robersheimer added a commit to robersheimer/jersey that referenced this issue Nov 29, 2021
Allows the proxy client holding a resource interface to supply
a bean of the corresponding type for the method fields annotated
with @BeanParam, instead of having to supply the associated
parameters individually. This also works if BeanParams themselves
contain fields annotated with @BeanParam.
robersheimer added a commit to robersheimer/jersey that referenced this issue Nov 29, 2021
Allows the proxy client holding a resource interface to supply
a bean of the corresponding type for the method fields annotated
with @BeanParam, instead of having to supply the associated
parameters individually. This also works if BeanParams themselves
contain fields annotated with @BeanParam.
jansupol pushed a commit that referenced this issue Dec 3, 2021
* Issue #3493 - Add BeanParam support to WebResourceFactory

Allows the proxy client holding a resource interface to supply
a bean of the corresponding type for the method fields annotated
with @BeanParam, instead of having to supply the associated
parameters individually. This also works if BeanParams themselves
contain fields annotated with @BeanParam.
jansupol pushed a commit to jansupol/jersey that referenced this issue Feb 8, 2022
…eclipse-ee4j#4919)

* Issue eclipse-ee4j#3493 - Add BeanParam support to WebResourceFactory

Allows the proxy client holding a resource interface to supply
a bean of the corresponding type for the method fields annotated
with @BeanParam, instead of having to supply the associated
parameters individually. This also works if BeanParams themselves
contain fields annotated with @BeanParam.
senivam pushed a commit that referenced this issue Feb 8, 2022
* Issue #3493 - Add BeanParam support to WebResourceFactory

Allows the proxy client holding a resource interface to supply
a bean of the corresponding type for the method fields annotated
with @BeanParam, instead of having to supply the associated
parameters individually. This also works if BeanParams themselves
contain fields annotated with @BeanParam.
@hoangbnc
Copy link

I saw @BeanParam being added to WebResourceFactory in v3. Could that be backported to v2 as well?

@oramattkosem
Copy link

oramattkosem commented Jun 14, 2023

I would like that as well. This would be a helpful feature addition in v2.

senivam pushed a commit that referenced this issue Aug 15, 2023
Co-Authored-By: Richard Obersheimer <[email protected]>
Signed-off-by: Denis Karabetsky <[email protected]>
@prmx
Copy link
Contributor

prmx commented Dec 20, 2023

This issue could be closed, as BeanParams support already backported to jersey#2.41

@senivam
Copy link
Contributor

senivam commented Dec 21, 2023

closed as resolved

@senivam senivam closed this as completed Dec 21, 2023
@senivam senivam added this to the 2.41 milestone Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants