Search code examples
http-status-code-404quarkushttp-status-code-400quarkus-reactive

Quarkus returns 404 instead of 400


@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("/greeting/{name}")
public Uni<String> greeting(String name, @QueryParam("limit") int limit) {
     return service.greeting(name.toString());
}

localhost:8080/greeting/someName?limit=454 -- this returns 200 as expected localhost:8080/greeting/someName?limit=dfg -- this one returns 404 instead of 400

In a Quarkus application an endpoint returns wrong error code(404 instead of 400)

But in a Spring boot non reactive application this works fine(returns 400)


Solution

  • Query param conversion errors are treaten as 404 (and not as 400 as expected) as for specification (https://eclipse-ee4j.github.io/jersey.github.io/documentation/latest3x/jaxrs-resources.html#d0e2052).