Example of Micronaut's @QueryValue annotation failing compilation step when parameter specified as not null
Issue: micronaut-projects/micronaut-core#1812
- Steps to reproduce provided
- Stacktrace (if present) provided
- Example that reproduces the problem uploaded to Github
- Full description of the issue provided (see below)
- Create a declarative client in kotlin like the following:
interface ExampleOperations {
@Get("{?test}")
fun get(@QueryValue test: Boolean): Boolean
}
- Attempt to build the project
The project should be able to compile and allow a non nullable Boolean @QueryValue
.
We get the following compilation error expecting the Boolean
property to be Optional
error: The uri variable [test] is optional, but the corresponding method argument [boolean test] is not defined as an Optional or annotated with the javax.annotation.Nullable annotation.
public boolean get(boolean test) {
- Operating System: macOS mojave 10.14.4
- Micronaut Version: 1.1.1
- JDK Version: 1.8.0_191