{"record":{"id":"93144cf062092077","repo":"quarkusio/quarkus","slug":"currently-only-fruitsfindby-type-name-is-support-93144c","errorCode":null,"errorMessage":"Currently only 'fruitsFindBy?type=name' is supported","messagePattern":"Currently only 'fruitsFindBy\\?type=name' is supported","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"warning","filePath":"integration-tests/hibernate-orm-tenancy/connection-resolver-legacy-qualifiers/src/main/java/io/quarkus/it/hibernate/multitenancy/fruit/FruitResource.java","lineNumber":166,"sourceCode":"        entityManager.remove(fruit);\n        return Response.status(204).build();\n    }\n\n    @GET\n    @Path(\"fruitsFindBy\")\n    public Response findByDefault(@NotNull @QueryParam(\"type\") String type, @NotNull @QueryParam(\"value\") String value) {\n        return findBy(type, value);\n    }\n\n    @GET\n    @Path(\"{tenant}/fruitsFindBy\")\n    public Response findByTenant(@NotNull @QueryParam(\"type\") String type, @NotNull @QueryParam(\"value\") String value) {\n        return findBy(type, value);\n    }\n\n    private Response findBy(@NotNull String type, @NotNull String value) {\n        if (!\"name\".equalsIgnoreCase(type)) {\n            throw new IllegalArgumentException(\"Currently only 'fruitsFindBy?type=name' is supported\");\n        }\n        List<Fruit> list = entityManager.createNamedQuery(\"Fruits.findByName\", Fruit.class).setParameter(\"name\", value)\n                .getResultList();\n        if (list.size() == 0) {\n            return Response.status(404).build();\n        }\n        Fruit fruit = list.get(0);\n        return Response.status(200).entity(fruit).build();\n    }\n\n    @Provider\n    public static class ErrorMapper implements ExceptionMapper<Exception> {\n\n        @Override\n        public Response toResponse(Exception exception) {\n            LOG.error(\"Failed to handle request\", exception);\n\n            int code = 500;","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/integration-tests/hibernate-orm-tenancy/connection-resolver-legacy-qualifiers/src/main/java/io/quarkus/it/hibernate/multitenancy/fruit/FruitResource.java#L148-L184","documentation":"FruitResource.findBy only supports searching by name via the named query Fruits.findByName. Any type query parameter other than 'name' (case-insensitive) is rejected with an IllegalArgumentException, which RESTEasy maps to an HTTP 500 unless an exception mapper handles it.","triggerScenarios":"GET /fruitsFindBy?type=<anything-but-name>&value=... , including empty, misspelled (\"names\", \"Name \" with whitespace), or other field types like id.","commonSituations":"Client guesses at filter field names, API evolves and older clients use removed query types, or value/type parameters are swapped.","solutions":["Call with type=name: GET /fruitsFindBy?type=name&value=Apple.","Fix client code or docs to use the only supported filter.","If other filters are needed, extend the resource with additional named queries and branches for those types."],"exampleFix":"// before\nGET /fruitsFindBy?type=id&value=1\n// after\nGET /fruitsFindBy?type=name&value=Apple","handlingStrategy":"validation","validationCode":"if (!\"name\".equalsIgnoreCase(type)) {\n    throw new IllegalArgumentException(\"Only type=name is supported on fruitsFindBy\");\n}","typeGuard":"boolean isNameSearch(String type) {\n    return \"name\".equalsIgnoreCase(type);\n}","tryCatchPattern":"try {\n    return target(\"fruitsFindBy\").queryParam(\"type\", \"name\").queryParam(\"value\", value).request().get();\n} catch (WebApplicationException e) {\n    log.error(\"Search rejected: \" + e.getMessage());\n}","preventionTips":["Hardcode type=name in client helpers","Trim/lowercase the type param before comparing","Document supported query types in the API docs","Add client-side enum of allowed filter types"],"tags":["rest","query-params","validation"],"backgroundTag":"unsupported-query-parameter","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}