-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Can't send Path Params and Body at same request via PUT or POST #399
Comments
I'm having the same issue using Feign 8.16.2. Is there any reasons to this hard coded limitation ? |
My [not elegant, I know] solution was copy the feign.Contract Interface to my source and comment out lines 104 and 105. |
I don't think this limitation is intentional. It seems like a bug |
I'm so far unable to reproduce this issue
#421
|
I just ran into something similar and I wonder if it might be related. In my case, the Feign annotation Param was confused with the Spring Data annotation with the same name. So, since I inadvertently used the Spring version, I hadn't actually specified a Feign path parameter as Param, so it assumed I wanted it to be a body parameter. Then, the actual unannotated body parameter caused a validation failure. The error messages Feign generates say the parameters conflict somehow, but doesn't specify details beyond the message signature. Wonder if there would be value in beefing up the error messages to give the state of the validator? If I knew which ones it thought were body parameters and which it thought were form parameters and path parameters, I might've figured it out without debug stepping. Perhaps just return a toString for the MethodMetadata object on validation failures? |
It's definitely broken if you use javax.ws.rs.PathParam, but if you switch to feign.Param it works. |
Hmm can you post an example method definition which breaks? Please dont
cross streams (mix feign and jaxrs annotations as we wouldnt expect that to
work.. not saying you would..)
…On 29 Mar 2017 22:52, "Franco" ***@***.***> wrote:
It's definitely broken if you use javax.ws.rs.PathParam, but if you switch
to feign.Param it works.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#399 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAD61-j99k2e8S53VWem3qUeBlUTOieJks5rqnAmgaJpZM4IssPA>
.
|
Sorry it wasn't my code, I just told them to change to the feign annotation and that fixed it, what I can say is they were using jaxrs annotations in other cases and it was working as expected, it was only in this case (mixing requestline put, with a body and jaxrs pathparam) that it wasn't. It seems like a different problem, however it'd be good to recognise if you are seeing cross streams and either support it or not support it but do so explicitly. The error sounded similar but upon reading again it seems like a different thing. |
thx I'll close this for now. Validating jax-rs annotations aren't used from feign-core would be a chicken/egg. From jax-rs, we could consider checking if any feign-core annotations are in use (as that would be a bug). I'll leave that as an exercise for a contributor with enough interest to do that. Another way is to use something like error-prone which would make a compile check out of issues like this. It is another form of checking a contract, but it could depend on multiple "contracts" or otherwise be taught what bad is... |
I've seem something at #310, but still occurs.
Feign version: 8.16.2
Interface:
Call:
StackTrace:
I know using path param and request body at same request is not a good approach, but the REST API is not our.
The text was updated successfully, but these errors were encountered: