Can't determine if RequestTemplate or Request has a null body
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.8k
- Forks
- 1.9k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 41
Description
Hi
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 :
public static void main(String[] args)
{
Request.create(HttpMethod.GET,
"http://patate.com",
Collections.emptyMap(),
(Request.Body) null,
(RequestTemplate) null)
.body();
}
If there is a non nullability constraint in both classes, there should be preconditions in the constructors and clear java documentation for users.
Thanks
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the Request and RequestTemplate APIs around requestBody() and body(), then reproduce the null-body example from the issue. Determine the intended nullability behavior for both classes; done should include consistent handling and clear documentation or preconditions for callers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100