-
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
Encode issue with feign.template.Template#resolveExpression #2476
Labels
feedback provided
Feedback has been provided to the author
Comments
|
TLDR; use an |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I customized an AnnotatedParameterProcessor implementation class.
But I encountered a problem: when I use the following code to put the parameter into the request body.
Such as the bodyTemplate‘s value is: %7B"ab":{ab}%7D, and the variable(ab) is a Array or a List.
feign.template.Template#resolveExpression
feign.template.Expressions.SimpleExpression#expand
When the variable is of type Iterable, it will be handle and encode. But I don't want to handle my variable.
How should i control it.
I customized an AnnotatedParameterProcessor to encapsulate the parameters on the feignclient method(POST) into a format like {"a":{a},"b":{b},"c":{c}}, and then put it into the bodyTemplate. Then, in feign.RequestTemplate#resolve(java.util.Map<java.lang.String,?>) replace {a} in the body with the real value, and put this string into the request body (JSON format). However, if {c} is a List, it will be encoded.
{"a":1,"b":test,"c":[],"d":{}},but variable c will be processed into other formats and encoded (like in URLs).
The text was updated successfully, but these errors were encountered: