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

fix inconsistent bug #1137

Merged
merged 1 commit into from Dec 30, 2019
Merged

fix inconsistent bug #1137

merged 1 commit into from Dec 30, 2019

Conversation

switchYello
Copy link
Contributor

According to test case,if we use Fegin like:

@RequestLine("POST /")
void formParamAndBodyParams(
        @Param("customer_name") String customer,
        String body);

Fegin will throw exception message Body parameters cannot be used with form parameters..

But we reverse params like:

@RequestLine("POST /")
void bodyParamsAndformParam(
        String body,
        @Param("customer_name") String customer);

Fegin not throw exception , only ignore formParams, so it is inconsistent.

This PR fix this inconsistent , always check Body parameters and form parameters.

when we both use bodyParams and formParam.
if `formParam param's order` before `bodyParams param's order` Feign will throw exception message `Body parameters cannot be used with form parameters.`.

Bug if `formParam param's order` after `bodyParams param's order` Fegin not throw exception,it is `inconsistent`.

test code like:
```java

@RequestLine("POST /")
void formParamAndBodyParams(
        @param("customer_name") String customer,
        String body);

@RequestLine("POST /")
void bodyParamsAndformParam(
        String body,
        @param("customer_name") String customer);

```
build this two method see.
@switchYello switchYello changed the title fix: bodyParams before formParam not check does not cause an exception fix inconsistent bug Dec 25, 2019
Copy link
Member

@kdavisk6 kdavisk6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thank you for taking the time to correct this issue.

@kdavisk6 kdavisk6 added the ready to merge Will be merged if no other member ask for changes label Dec 27, 2019
@kdavisk6 kdavisk6 added this to the 10.7.1 milestone Dec 27, 2019
@kdavisk6 kdavisk6 merged commit 6e64865 into OpenFeign:master Dec 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Will be merged if no other member ask for changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants