You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can't determine if RequestTemplate or Request has a null body #1210
In the process of updating feign from version 10.2.3 to 10.7.4, I noticed some deprecation in my codebase on internal code dealing with RequestTemplate and Request. The methods RequestTemplate::requestBody has been marked as deprecated and Request::requestBody has been removed.
I'm fine with moving on and building something better obviously but it seems there is no non deprecated replacement to detect a null body in both classes. For example, this simple code will throw a NPE :
changed the title [-]Can't determine if `RequestTemplate` or `Request` has a `null` body[/-][+]Can't determine if RequestTemplate or Request has a null body[/+]on Apr 16, 2020
Documentation in the latest version does indicate that body and requestTemplate can be null, however the function Request#body does not properly check the body to ensure that it is present. This is an oversight on our part. I've marked this issue as a bug for us to triage and correct. Thanks!
Activity
[-]Can't determine if `RequestTemplate` or `Request` has a `null` body[/-][+]Can't determine if RequestTemplate or Request has a null body[/+]kdavisk6 commentedon Apr 25, 2020
@jebeaudet
Documentation in the latest version does indicate that
bodyandrequestTemplatecan benull, however the functionRequest#bodydoes not properly check thebodyto ensure that it is present. This is an oversight on our part. I've marked this issue as a bug for us to triage and correct. Thanks!OpenFeign#1210 attempt to fix null body issue
OpenFeign#1210 add logic to getter instead of changing constructor
OpenFeign#1210 second revision
Dainerx commentedon May 17, 2023
Hello,
I am having the same issue as @jebeaudet. I saw the fix PR was closed, and no other PRs were linked.
Will this issue be tackled? Or do you have any recommendation to check whether a RequestTemplate contains a non body?
Thanks,
Merge pull request #3605 from sharanggupta/gh-1210-null-request-body
Treat a null Request.Body as a request with no body