{"record":{"id":"d63a856a2a8357e4","repo":"quarkusio/quarkus","slug":"missing-required-data-expression-tooriginals","errorCode":null,"errorMessage":"Missing required data: {\" + expression.toOriginalString() + \"}","messagePattern":"Missing required data: (.+?)","errorType":"exception","errorClass":"TemplateException","httpStatus":null,"severity":"error","filePath":"independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/core/reader/QuteCodestartFileReader.java","lineNumber":148,"sourceCode":"        }\n\n        @Override\n        public Optional<Variant> getVariant() {\n            return Optional.empty();\n        }\n    }\n\n    static class MissingValueMapper implements ResultMapper {\n\n        public boolean appliesTo(TemplateNode.Origin origin, Object result) {\n            return Results.isNotFound(result);\n        }\n\n        public String map(Object result, Expression expression) {\n            if (expression.toOriginalString().equals(\"merged-content\")) {\n                return \"{merged-content}\";\n            }\n            throw new TemplateException(\"Missing required data: {\" + expression.toOriginalString() + \"}\");\n        }\n    }\n\n    /**\n     * private static CompletionStage<Object> replaceResolveAsync(EvalContext context) {\n     * String text = (String) context.getBase();\n     * switch (context.getName()) {\n     * case \"replace\":\n     * if (context.getParams().size() == 2) {\n     * return context.evaluate(context.getParams().get(0)).thenCombine(context.evaluate(context.getParams().get(1)),\n     * (r1, r2) -> CompletableFuture.completedFuture(text.replace(r1.toString(), r2.toString())));\n     * }\n     * default:\n     * return Results.NOT_FOUND;\n     * }\n     * }\n     **/\n","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/core/reader/QuteCodestartFileReader.java#L130-L166","documentation":"QuteCodestartFileReader installs a fallback value resolver for expressions not resolved from the provided data. Except for the special 'merged-content' marker, any unresolved expression makes rendering fail with this TemplateException. It guarantees templates only reference data actually supplied at generation time.","triggerScenarios":"Rendering a codestart Qute template that references {someExpression} not present in the generation data map and not defaulted with '?:' — the no-data fallback resolver throws for it.","commonSituations":"Typo in a data key inside the template; codestart data map missing a key the template expects; relying on Qute's null-value default behavior which this reader intentionally disables.","solutions":["Add the missing key/value to the data map passed to project generation","Correct the expression in the template to match an existing data key","Provide an inline default in the template: {myKey ?: 'fallback'}"],"exampleFix":"// before\nMap.of(\"name\", projectName) // template uses {groupId}\n// after\nMap.of(\"name\", projectName, \"groupId\", groupId)","handlingStrategy":"validation","validationCode":"// verify all {expr} tokens in templates are covered by data keys or '?:' defaults","typeGuard":null,"tryCatchPattern":"try { generate.generateProject(dir, data); }\ncatch (Exception e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"Missing required data:\")) { /* add key, retry */ }\n    else throw e;\n}","preventionTips":["Sync data map with template expressions","Use '?:' defaults for optional keys","Unit-test rendering with documented data"],"tags":["templating","qute","missing-data"],"backgroundTag":"missing-data-template","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"}