eclipse-ee4j / eclipse-ee4j/jersey
Remove warning for void GET methods
- Dominant language
- Java
- Stars
- 730
- Forks
- 382
- PR merge metrics
- No merged PRs in 30d
Description
Jersey logs following WARNING for void GET methods:
```
WARNING: The following warnings have been detected: HINT: A HTTP GET method, public void SomeResource.get(java.lang.String), returns a void type. It can be intentional and perfectly fine, but it is a little uncommon that GET method returns always "204 No Content".
```
Is this really necessary? As the message states a 204 can be perfectly fine for a GET method so I wouldn't classify this as WARNING.
The MVC-Specification (JSR-371) defines a [@View](https://java.net/projects/mvc-spec/sources/git/content/api/src/main/java/javax/mvc/annotation/View.java?rev=99a78604237b10a6eec2b945fa7aa04e8031bf38) annotation which can be used for void methods so this warning will confuse a lot of developers.
Contributor guide
Research direction
Start by locating the Jersey validation or warning path that reports void HTTP GET methods, then inspect how a void return type is classified. Compare that behavior with the issue's example and the referenced @View annotation; done means intentional void GET methods no longer produce a WARNING while other relevant validation remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100