{"record":{"id":"191982390e7289e3","repo":"karatelabs/karate","slug":"missing-argument-for-paramvalues","errorCode":null,"errorMessage":"missing argument for paramValues()","messagePattern":"missing argument for paramValues\\(\\)","errorType":"validation","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"karate-core/src/main/java/io/karatelabs/http/HttpRequest.java","lineNumber":553,"sourceCode":"        return builder;\n    }\n\n    private JavaInvokable param() {\n        return args -> {\n            if (args.length > 0) {\n                return getParam(args[0] + \"\");\n            } else {\n                throw new RuntimeException(\"missing argument for param()\");\n            }\n        };\n    }\n\n    private JavaInvokable paramValues() {\n        return args -> {\n            if (args.length > 0) {\n                return getParamValues(args[0] + \"\");\n            } else {\n                throw new RuntimeException(\"missing argument for paramValues()\");\n            }\n        };\n    }\n\n    private JavaInvokable paramInt() {\n        return args -> {\n            if (args.length > 0) {\n                String val = getParam(args[0] + \"\");\n                return val == null ? null : Integer.parseInt(val);\n            } else {\n                throw new RuntimeException(\"missing argument for paramInt()\");\n            }\n        };\n    }\n\n    private JavaInvokable paramJson() {\n        return args -> {\n            if (args.length > 0) {","sourceCodeStart":535,"sourceCodeEnd":571,"githubUrl":"https://github.com/karatelabs/karate/blob/a22eb90246d958d15a47bf436693d0121ad2812d/karate-core/src/main/java/io/karatelabs/http/HttpRequest.java#L535-L571","documentation":"The request.paramValues() invokable requires one argument (the parameter name) and returns all values for it. Called with zero arguments it throws RuntimeException 'missing argument for paramValues()'.","triggerScenarios":"Calling request.paramValues() with no arguments instead of request.paramValues('name').","commonSituations":"Same as param(): omitted argument during hand-editing, empty variable interpolated into a script, misunderstanding that the method lists all params when called bare.","solutions":["Pass the parameter name: request.paramValues('tag')","Ensure the source of the name (variable/config) is populated before the call","Use the correct no-arg API if one exists for listing all parameters"],"exampleFix":"// before\nvar vs = request.paramValues();\n// after\nvar vs = request.paramValues('tag');","handlingStrategy":"type-guard","validationCode":"if (name == null || name.isEmpty()) throw new IllegalArgumentException(\"param name required\");","typeGuard":"function requireArg(name, args) { if (args == null || args.length === 0) throw new Error('missing argument for paramValues()'); return name; }","tryCatchPattern":"try { var vs = request.paramValues('tag'); } catch (RuntimeException e) { /* fix call site: name argument missing */ }","preventionTips":["Always pass the parameter name to paramValues()","Check variables interpolated into scripts are populated","Remember paramValues returns a list; param returns the last value"],"tags":["http","arguments","api-misuse"],"backgroundTag":"missing-required-argument","analyzedSha":"a22eb90246d958d15a47bf436693d0121ad2812d","analyzedAt":"2026-09-12T09:01:00.220Z","contentChangedAt":"2026-09-12T09:01:00.220Z","schemaVersion":2},"datasetVersion":"2026-09-16T19:17:19.609Z"}