-
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
Remove query template empty argument filtering #1043
Conversation
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.
The spec states that we should ignore any undefined
values. While your changes appear to fix the issue, it's only masking it. The real fix belongs in the expand
functions. In particular, we need to return a special value when an expression is unresolved and not an empty string.
I suggest that, if you are still interested, look at Template
, specifically lines 88 - 91. We should probably return a special value when resolvedExpression
is null
. Take a look and let me know. If you are unsure, I can help
@kdavisk6 roger that. I'll take a look |
After we expand vars map in Template we have fine result @ feign/RequestTemplate.java:182 Bad moment is when we goes to feign.RequestTemplate#extractQueryTemplates. We provide fine data and then RequestTemplate ruins out work with his filter. I don't know, may be I can add some specific value such as "EMPTY" (this is not null, it's like empty) on preparing stage and parse it replacing EMPTY with "", but this is a string received from string and there is a chance user make same... |
You are on the right track. We need to explicitly call out when a value is undefined and then update our filtering logic to excluded those undefined values. One way is to assume that |
Hi @kdavisk6
Looks like we have the two inceptions - for annotation and for reflective clients, that call one method - uri() and then must call different methods in QueryTemplate - one with filtering and other without. Or risk with substituted String value... I really need your advice at that point. |
This has been superseded by #1138 |
To allow empty values appear in request.
I've found only one way to change it. I don't like that both query string and arguments parsed via one class. Also removed code was added to create filter I have removed. It's strange. But test works fine after removing filter.