{"record":{"id":"cd3c1b1cfd27612d","repo":"OpenAPITools/openapi-generator","slug":"invalid-operationidnaming-operationidnaming","errorCode":null,"errorMessage":"Invalid operationIdNaming: \" + operationIdNaming + \". Must be PascalCase, camelCase or snake_case","messagePattern":"Invalid operationIdNaming: \" \\+ operationIdNaming \\+ \"\\. Must be PascalCase, camelCase or snake_case","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java","lineNumber":666,"sourceCode":"    }\n\n    public void setExceptionPackageToUse(String exceptionPackage) {\n        if (DEFAULT.equals(exceptionPackage))\n            this.useDefaultExceptionHandling = true;\n        if (RLANG.equals(exceptionPackage)) {\n            supportingFiles.add(new SupportingFile(\"api_exception.mustache\", File.separator + \"R\", \"api_exception.R\"));\n            this.useRlangExceptionHandling = true;\n        }\n    }\n\n    public boolean getUseOneOfDiscriminatorLookup() {\n        return this.useOneOfDiscriminatorLookup;\n    }\n\n    public void setOperationIdNaming(final String operationIdNaming) {\n        if (!(\"PascalCase\".equals(operationIdNaming) || \"camelCase\".equals(operationIdNaming) ||\n                \"snake_case\".equals(operationIdNaming))) {\n            throw new IllegalArgumentException(\"Invalid operationIdNaming: \" + operationIdNaming +\n                    \". Must be PascalCase, camelCase or snake_case\");\n        }\n\n        if (\"snake_case\".equals(operationIdNaming)) {\n            additionalProperties.put(\"WithHttpInfo\", \"_with_http_info\");\n        } else {\n            additionalProperties.put(\"WithHttpInfo\", \"WithHttpInfo\");\n        }\n\n        this.operationIdNaming = operationIdNaming;\n    }\n\n    @Override\n    public String escapeQuotationMark(String input) {\n        // remove \" to avoid code injection\n        return input.replace(\"\\\"\", \"\");\n    }\n","sourceCodeStart":648,"sourceCodeEnd":684,"githubUrl":"https://github.com/OpenAPITools/openapi-generator/blob/fcec517be3cf5b7964296bcba25fbc97541484e7/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java#L648-L684","documentation":"The R generator's setOperationIdNaming() only accepts the literal strings 'PascalCase', 'camelCase', or 'snake_case' (exact casing); anything else throws IllegalArgumentException. The chosen value also drives the WithHttpInfo suffix used in generated function names ('_with_http_info' for snake_case).","triggerScenarios":"openapi-generator-cli generate -i api.yaml -g r -c operationIdNaming=Pascalcase / snake-case / snake / kebab-case. The comparison is String.equals, so any casing or spelling deviation fails.","commonSituations":"Users typing the style descriptively ('SnakeCase', 'SCREAMING_SNAKE') instead of the exact token; configs migrated from other generators whose naming options accept different vocabularies (e.g. --operation-id-name vs operationIdNaming).","solutions":["Use one of the exact tokens: operationIdNaming=PascalCase, operationIdNaming=camelCase, or operationIdNaming=snake_case","Check for stray whitespace/quotes in the config file around the value","If unset, omit the option to keep the default naming"],"exampleFix":"# before\nopenapi-generator-cli generate -i api.yaml -g r -c operationIdNaming=snake-case\n# after\nopenapi-generator-cli generate -i api.yaml -g r -c operationIdNaming=snake_case","handlingStrategy":"validation","validationCode":"# bash: exact-token whitelist\nOP_NAMING=\"${OP_NAMING:-}\"\n[[ -z \"${OP_NAMING}\" || \"${OP_NAMING}\" == PascalCase || \"${OP_NAMING}\" == camelCase || \"${OP_NAMING}\" == snake_case ]] \\\n  || { echo 'operationIdNaming must be PascalCase, camelCase or snake_case (exact)'; exit 1; }","typeGuard":null,"tryCatchPattern":"try {\n    RClientCodegen codegen = new RClientCodegen();\n    codegen.setOperationIdNaming(\"snake_case\"); // one of the three exact tokens\n    new DefaultGenerator().opts(input).generate();\n} catch (IllegalArgumentException e) {\n    // 'Invalid operationIdNaming' - use the exact token and rerun\n}","preventionTips":["Treat the three naming tokens as an enum, not free text","Beware casing: snake_case is lowercase, PascalCase and camelCase are exact","Document the allowed tokens next to your generation scripts"],"tags":["r","codegen","configuration","naming","openapi-generator"],"backgroundTag":"unsupported-library-option","analyzedSha":"fcec517be3cf5b7964296bcba25fbc97541484e7","analyzedAt":"2026-08-22T11:13:11.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}