Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@dyc87112
Copy link

hello, this pull request is to make the request Body to be an optional properties.

Current version, if the body is null, feign will return error message “Body parameter %s was null”.

If this PR can be accept. Then I can fix another issue in Spring Cloud Feign:https://github.com/spring-cloud/spring-cloud-netflix/issues/1047

Thanks.

@velo
Copy link
Member

velo commented Mar 11, 2018

Hey, why don't you overload the method, creating a new one without the body.

That would accomplish it without passing nulls forward.

I see a point on supporting Optional<Body>.

Lemme know what you think.

@kdavisk6
Copy link
Member

@dyc87112 There are no test cases included in this PR. Could you please add some to ensure that we have coverage?

@kdavisk6 kdavisk6 added the waiting for feedback Issues waiting for a response from either to the author or other maintainers label Jul 16, 2018
@kdavisk6
Copy link
Member

ping?

How would you intend for the bodyRequired flag to be set?

@velo
Copy link
Member

velo commented Nov 15, 2018

2 months no feedback. Closing, please re-open if necessary

@velo velo closed this Nov 15, 2018
@cezar-tech
Copy link
Contributor

cezar-tech commented Oct 17, 2019

@velo @kdavisk6
If you are interested perhaps I can help but I understand ver few of how Feign works internally.
If you could explain me how to do it I can give a try.

@velo
Copy link
Member

velo commented Oct 17, 2019

Well, I'm not sure what was the goal on this pr.

You would need the author back on the discussion.

@OlgaMaciaszek
Copy link

Hi, @dyc87112 @velo @kdavisk6 I would like to reopen the discussion of this PR. This kind of functionality would be useful for us to fix this issue, also discussed here. I see the PR was closed due to lack of tests and feedback. I can take it over and add tests if you are fine with adding this feature.

@velo
Copy link
Member

velo commented May 12, 2020

Lemme see if I got it correctly.

Spring has an annotation @RequestBody that can be used to "ignore" a parameter.

So, you looking for a mechanism to tell feign to not process a parameter?!

Saw many comments on the ticket and didn't read them all.

@kdavisk6
Copy link
Member

@OlgaMaciaszek

Can please create a new issue referencing your issue? I'd like to move the discussion there so it does not get lost.

@SribniyOleg
Copy link

@kdavisk6
Hi - i can refactor this pr or just create a new one with this case.
In my case I'm facing with the same issue with the author - just need to enable Feign to support RequestBody(required = false ) cuz I need to the optional body for my logic

@velo
Copy link
Member

velo commented Aug 5, 2021

We need to differentiate NULL body, from absent

Having another boolean flag is not healthy they will explode out of control someday

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting for feedback Issues waiting for a response from either to the author or other maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants