{"record":{"id":"179c5ae5ed2e8031","repo":"quarkusio/quarkus","slug":"currently-only-fruitsfindby-type-name-is-support","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/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/src/main/java/io/quarkus/it/hibernate/multitenancy/fruit/FruitResource.java#L148-L184","documentation":"The findBy endpoint only supports filtering by name; any other 'type' query parameter value is rejected with an IllegalArgumentException (resulting in a 500 unless mapped), explicitly stating the only supported form is fruitsFindBy?type=name.","triggerScenarios":"Calling fruitsFindByDefault/fruitsFindByTenant with ?type=something-else&value=x, or omitting/mistyping the type parameter.","commonSituations":"Clients guessing at supported filter types (e.g. 'color', 'id'), case assumptions (although equalsIgnoreCase is used, so case is fine), or API drift between client and resource.","solutions":["Use type=name with the entity name as value","If another filter type is needed, extend the resource with a named query for it","Fix the client constant/enum producing the type value"],"exampleFix":"// before\nGET /fruits/findBy?type=color&value=red\n// after\nGET /fruits/findBy?type=name&value=Apple","handlingStrategy":"validation","validationCode":"if (!\"name\".equalsIgnoreCase(type)) throw new IllegalArgumentException(\"Only type=name is supported\");","typeGuard":null,"tryCatchPattern":"try { findBy(type, value); } catch (IllegalArgumentException e) { /* fall back to type=name or surface a 400 */ }","preventionTips":["Pin client filter types to the documented set (name only)","Fetch the resource's API contract rather than guessing parameter names","Fail fast on unknown filter enums"],"tags":["rest","illegal-argument","validation","query-parameter"],"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-14T00:17:10.932Z"}