{"record":{"id":"789fab9273e7cd4c","repo":"quarkusio/quarkus","slug":"index-parameter-is-missing","errorCode":null,"errorMessage":"Index parameter is missing","messagePattern":"Index parameter is missing","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"independent-projects/qute/core/src/main/java/io/quarkus/qute/ValueResolvers.java","lineNumber":444,"sourceCode":"                }\n                Expression indexExpr = context.getParams().get(0);\n                if (indexExpr.isLiteral()) {\n                    Object literalValue = indexExpr.getLiteral();\n                    if (literalValue instanceof Integer) {\n                        return CompletedStage.of(takeLastArray((Integer) literalValue, context.getBase()));\n                    }\n                    return Results.notFound(context);\n                } else {\n                    return context.evaluate(indexExpr).thenCompose(n -> {\n                        if (n instanceof Integer) {\n                            return CompletedStage.of(takeLastArray((Integer) n, context.getBase()));\n                        }\n                        return Results.notFound(context);\n                    });\n                }\n            } else if (name.equals(GET)) {\n                if (context.getParams().isEmpty()) {\n                    throw new IllegalArgumentException(\"Index parameter is missing\");\n                }\n                Expression indexExpr = context.getParams().get(0);\n                if (indexExpr.isLiteral()) {\n                    Object literalValue = indexExpr.getLiteral();\n                    if (literalValue instanceof Integer) {\n                        return CompletedStage.of(Array.get(context.getBase(), (Integer) literalValue));\n                    }\n                    return Results.notFound(context);\n                } else {\n                    return context.evaluate(indexExpr).thenCompose(idx -> {\n                        if (idx instanceof Integer) {\n                            return CompletedStage.of(Array.get(context.getBase(), (Integer) idx));\n                        }\n                        return Results.notFound(context);\n                    });\n                }\n            } else {\n                // Try to use the name as an index","sourceCodeStart":426,"sourceCodeEnd":462,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/qute/core/src/main/java/io/quarkus/qute/ValueResolvers.java#L426-L462","documentation":"Qute's ArrayResolver resolves array access in templates via methods like `get(index)`. It throws this IllegalArgumentException when a `get` call is made on an array base value without supplying the required index parameter. The resolver requires exactly one parameter that evaluates to an Integer.","triggerScenarios":"A template expression on an array base value uses `get` with no parameter, e.g. `{myArray.get}` instead of `{myArray.get(0)}`, and `context.getParams().isEmpty()` is true in ArrayResolver.resolve at ValueResolvers.java:444.","commonSituations":"Template typos where parentheses/index were dropped; generating templates dynamically and forgetting to interpolate the index; refactoring `{myArray.0}` into `{myArray.get}` without adding the index argument.","solutions":["Supply the index parameter in the template: use `{myArray.get(0)}` or `{myArray.get(i)}`.","Use bracket/property index syntax instead: `{myArray.0}` or `{myArray[i]}` for loops over indices.","Guard with `{#if myArray.size > 0}` before calling get to ensure valid access."],"exampleFix":"// before (template)\n{myArray.get}\n// after (template)\n{myArray.get(0)}","handlingStrategy":"validation","validationCode":"// Java check before rendering\nif (array == null) throw new IllegalArgumentException(\"array data missing\");\n// in template, prefer guarded form:\n// {#if index >= 0 && index < array.length}{array.get(index)}{/if}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass an index to get(): {array.get(i)}","Prefer {array.0} or {array[i]} syntax to avoid missing-parameter mistakes","Guard loop indices with {#if i < array.length}"],"tags":["template","qute","illegal-argument","array-access"],"backgroundTag":"missing-required-argument","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"}