{"record":{"id":"4a5a904f8e726945","repo":"quarkusio/quarkus","slug":"invalid-expression-expression","errorCode":null,"errorMessage":"Invalid expression: ${expression}","messagePattern":"Invalid expression: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/resteasy-reactive/rest-client/runtime/src/main/java/io/quarkus/rest/client/reactive/runtime/ConfigUtils.java","lineNumber":29,"sourceCode":"\n    static final String PREFIX = \"${\";\n    static final String SUFFIX = \"}\";\n\n    /**\n     * Interpolates the given expression. The expression is expected to be in the form of ${config.property.name}.\n     *\n     * @param expression the expression to interpolate\n     * @param required whether the expression is required to be present in the configuration\n     * @return null if the resulting expression is empty, otherwise the interpolated expression\n     */\n    @SuppressWarnings(\"unused\")\n    public static String interpolate(String expression, boolean required) {\n        StringBuilder sb = new StringBuilder(expression);\n        int idx;\n        while ((idx = sb.lastIndexOf(PREFIX)) > -1) {\n            int endIdx = sb.indexOf(SUFFIX, idx);\n            if (endIdx < 0) {\n                throw new IllegalArgumentException(\"Invalid expression: \" + expression);\n            }\n            String configValue = getConfigValue(sb.substring(idx, endIdx + 1), required);\n            // If no value is found, we return null directly\n            if (configValue == null) {\n                return null;\n            }\n            sb.replace(idx, endIdx + 1, configValue);\n        }\n        if (sb.length() == 0) {\n            return null;\n        }\n        return sb.toString();\n    }\n\n    /**\n     * Obtains the value of the {@param configProperty} expression. This expressions MUST be in the form of ${...}\n     */\n    public static String getConfigValue(String configProperty, boolean required) {","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/resteasy-reactive/rest-client/runtime/src/main/java/io/quarkus/rest/client/reactive/runtime/ConfigUtils.java#L11-L47","documentation":"ConfigUtils.interpolate resolves MicroProfile config property placeholders of the form ${name} inside REST client values (URLs, URIs, proxies). This error is thrown when the expression contains ${ without a matching closing }, so the library cannot determine the property name. It is a syntax validation of the interpolated string.","triggerScenarios":"Passing a value to a rest client builder (e.g. baseUri/url/proxy config from application.properties or @RegisterRestClient config) that contains '${' with no '}' closing brace, such as a truncated or typo'd property reference.","commonSituations":"Typo in application.properties like quarkus.rest-client.myservice.url=${MY_URL; accidentally truncated string interpolation in code generation; shell/env placeholder copied verbatim without a closing brace.","solutions":["Add the missing closing brace '}' to the property reference","Escape or remove the stray '${' if no config substitution is intended","Verify the resolved value at build time by logging the raw property from application.properties"],"exampleFix":"# before\nquarkus.rest-client.svc.url=${API_HOST/api\n# after\nquarkus.rest-client.svc.url=${API_HOST}:8080/api","handlingStrategy":"validation","validationCode":"static void validateInterpolation(String expr) {\n    int open = 0;\n    for (int i = 0; i < expr.length(); i++) {\n        char c = expr.charAt(i);\n        if (c == '$' && i + 1 < expr.length() && expr.charAt(i + 1) == '{') open++;\n        else if (c == '}') open--;\n        if (open < 0) throw new IllegalArgumentException(\"Unmatched } in: \" + expr);\n    }\n    if (open != 0) throw new IllegalArgumentException(\"Unclosed ${ in: \" + expr);\n}","typeGuard":null,"tryCatchPattern":"try {\n    String url = ConfigUtils.interpolate(rawUrl, true);\n} catch (IllegalArgumentException e) {\n    throw new ConfigurationException(\"Malformed ${} expression in rest-client config: \" + rawUrl, e);\n}","preventionTips":["Always close ${...} references in application.properties","Log raw config values in a startup health check to spot malformed expressions early","Avoid hand-concatenating ${} strings; use config property expansion tooling"],"tags":["rest-client","config","expression-syntax"],"backgroundTag":"invalid-config-expression","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"}