{"record":{"id":"214045845bccc3d1","repo":"karatelabs/karate","slug":"configure-requires-assignment","errorCode":null,"errorMessage":"configure requires '=' assignment: ","messagePattern":"configure requires '=' assignment: ","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"karate-core/src/main/java/io/karatelabs/core/StepExecutor.java","lineNumber":3007,"sourceCode":"            html = runtime.getKarate().doc(Map.of(\"read\", path));\n        } else if (value instanceof Map) {\n            html = runtime.getKarate().doc((Map<String, Object>) value);\n        } else {\n            throw new RuntimeException(\"doc requires a string path or map with 'read' key, got: \" + value);\n        }\n        // Embed the rendered HTML in the step result for reports\n        if (html != null && !html.isEmpty()) {\n            LogContext.get().embed(html.getBytes(java.nio.charset.StandardCharsets.UTF_8), \"text/html\");\n        }\n    }\n\n    // ========== Config ==========\n\n    private void executeConfigure(Step step) {\n        String text = step.getText();\n        int eqIndex = StepUtils.findAssignmentOperator(text);\n        if (eqIndex < 0) {\n            throw new RuntimeException(\"configure requires '=' assignment: \" + text);\n        }\n        String key = text.substring(0, eqIndex).trim();\n        String expr = text.substring(eqIndex + 1).trim();\n        if (expr.isEmpty() && step.getDocString() != null) {\n            expr = step.getDocString();\n        }\n        Object value;\n        if (key.equals(\"javaBridgeEnabled\")) {\n            // Toggle Java interop (Java.type) for this engine. Mocks disable it by default\n            // so untrusted request data evaluated as embedded expressions cannot reach Java\n            // class loading; a trusted feature opts back in with `configure javaBridgeEnabled = true`.\n            Object enabled = evalKarateExpression(expr);\n            runtime.getKarate().setJavaBridgeEnabled(Boolean.parseBoolean(String.valueOf(enabled)));\n            return;\n        }\n        if (key.equals(\"requestExpressionsEnabled\")) {\n            // Opt a mock back in to evaluating embedded expressions in request-derived data\n            // (off by default). Re-opens the injection surface - only for trusted mocks.","sourceCodeStart":2989,"sourceCodeEnd":3025,"githubUrl":"https://github.com/karatelabs/karate/blob/a22eb90246d958d15a47bf436693d0121ad2812d/karate-core/src/main/java/io/karatelabs/core/StepExecutor.java#L2989-L3025","documentation":"The `configure` keyword requires the form `configure key = expression`; the step text must contain an '=' assignment operator for StepUtils.findAssignmentOperator to split the key from the value expression. When no '=' is present the executor cannot determine what to configure and throws with the full step text.","triggerScenarios":"Writing `configure headers` without `= value`; using `:` or other separators instead of `=`; configure with only a docstring but no `=` in the text (the docstring fallback only applies AFTER the '=' split succeeds).","commonSituations":"Typos like `configure retry count 5`; pasting config from JSON-style syntax; translating `karate.configure('x', y)` JS calls into keyword form incorrectly.","solutions":["Add the '=' assignment: `configure headers = { Authorization: 'Bearer x' }`","If the value is large, keep '=' with an empty expression and supply a docstring","Replace with JS form: `karate.configure('key', value)` inside an eval step","Check for typos that swallowed the '=' character"],"exampleFix":"// before\n* configure ssl true\n// after\n* configure ssl = true","handlingStrategy":"validation","validationCode":"// step text check in custom runner\nif (!stepText.contains(\"=\")) throw new IllegalArgumentException(\"configure requires '=' assignment\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always write configure as key = value","Use docstrings only after '=' with an empty expression","Search test suites for 'configure ' steps lacking '='"],"tags":["configure","syntax","assignment"],"backgroundTag":"invalid-argument-format","analyzedSha":"a22eb90246d958d15a47bf436693d0121ad2812d","analyzedAt":"2026-09-12T09:01:00.220Z","contentChangedAt":"2026-09-12T09:01:00.220Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}