0

GET http://localhost:8080/system/version

GET http://localhost:8080/system/version/

import io.micronaut.http.annotation.Controller;
import io.micronaut.http.annotation.Get;

@Controller("/system")
public class SystemController {
    @Get(uri = "/version/")
    public String version() {
        return SystemController.class.getPackage().getImplementationVersion();
    }
}

leads to

{
"message": "Page Not Found",
"_links": {
    "self": {
        "href": "/system/version/",
        "templated": false
    }
}
}

How to fix this?

Arthur
  • 1,156
  • 3
  • 20
  • 49

1 Answers1

3

If a controller method like that returns null, that will result in a 404. I expect that SystemController.class.getPackage().getImplementationVersion() is evaluating to null.

Jeff Scott Brown
  • 26,804
  • 2
  • 30
  • 47