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

Empty query parameter is being filtred out in a Collection based query #1028

Closed
Ashxvi opened this issue Jul 31, 2019 · 0 comments · Fixed by #1138
Closed

Empty query parameter is being filtred out in a Collection based query #1028

Ashxvi opened this issue Jul 31, 2019 · 0 comments · Fixed by #1138
Assignees
Labels
bug Unexpected or incorrect behavior

Comments

@Ashxvi
Copy link

Ashxvi commented Jul 31, 2019

I'm using the version 10.2.3 of the library, then I noticed that an empty string of my List is being filtered out which goes against the RFC 6570 "only undefined
values should be filtered out".

Example :

public interface TestClient {
    @RequestLine("GET /test?people={people}")
    Boolean isEligible(@Param(value = "people", encoded = true) Collection<String> people);
}

thereby,

public void test_with_empty_name() {
   Boolean isEligible = testClient.isEligible(List.of("","John","Stan"));
}

results in :

.../test?people=John&people=Stan

while the expected result is :

.../test?people=&people=John&people=Stan

@kdavisk6 kdavisk6 added breaking change Change that proposes a non-backward compatible breaking change bug Unexpected or incorrect behavior and removed breaking change Change that proposes a non-backward compatible breaking change labels Jul 31, 2019
kdavisk6 added a commit to kdavisk6/feign that referenced this issue Dec 26, 2019
Fixes OpenFeign#1123, Fixes OpenFeign#1133, Fixes OpenFeign#1102, Fixes OpenFeign#1028

Ensures that all expressions are fully-encoded before being
manipulated during template expansion.  This allows parameters
to include reserved values and result in properly encoded
results.

Additionally, `Iterable` values are now handled in accordance
with RFC 6570 allowing for the specified `CollectionFormat` to
be applied and empty parameters to be expanded correctly as this
is the main use case that exhibited this issue.
@kdavisk6 kdavisk6 self-assigned this Dec 26, 2019
kdavisk6 added a commit to kdavisk6/feign that referenced this issue Dec 27, 2019
Fixes OpenFeign#1123, Fixes OpenFeign#1133, Fixes OpenFeign#1102, Fixes OpenFeign#1028

Ensures that all expressions are fully-encoded before being
manipulated during template expansion.  This allows parameters
to include reserved values and result in properly encoded
results.

Additionally, `Iterable` values are now handled in accordance
with RFC 6570 allowing for the specified `CollectionFormat` to
be applied and empty parameters to be expanded correctly as this
is the main use case that exhibited this issue.
kdavisk6 added a commit that referenced this issue Dec 27, 2019
* Ensure Iterable values are encoded before template expansion

Fixes #1123, Fixes #1133, Fixes #1102, Fixes #1028

Ensures that all expressions are fully-encoded before being
manipulated during template expansion.  This allows parameters
to include reserved values and result in properly encoded
results.

Additionally, `Iterable` values are now handled in accordance
with RFC 6570 allowing for the specified `CollectionFormat` to
be applied and empty parameters to be expanded correctly as this
is the main use case that exhibited this issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants