{"record":{"id":"75ded544aab2297b","repo":"OpenAPITools/openapi-generator","slug":"invalid-file-naming-must-be-camelcase-or","errorCode":null,"errorMessage":"Invalid file naming '{}'. Must be 'camelCase' or 'kebab-case'","messagePattern":"Invalid file naming '(.+?)'\\. Must be 'camelCase' or 'kebab-case'","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java","lineNumber":727,"sourceCode":"            String values = Stream.of(QUERY_PARAM_OBJECT_FORMAT_TYPE.values())\n                    .map(value -> \"'\" + value.name() + \"'\")\n                    .collect(Collectors.joining(\", \"));\n\n            String msg = String.format(Locale.ROOT, \"Invalid query param object format '%s'. Must be one of %s.\", format, values);\n            throw new IllegalArgumentException(msg);\n        }\n    }\n\n    /**\n     * Set the file naming type.\n     *\n     * @param fileNaming the file naming to use\n     */\n    private void setFileNaming(String fileNaming) {\n        if (\"camelCase\".equals(fileNaming) || \"kebab-case\".equals(fileNaming)) {\n            this.fileNaming = fileNaming;\n        } else {\n            throw new IllegalArgumentException(\"Invalid file naming '\" +\n                    fileNaming + \"'. Must be 'camelCase' or 'kebab-case'\");\n        }\n    }\n\n    /**\n     * Converts the original name according to the current <code>fileNaming</code> strategy.\n     *\n     * @param originalName the original name to transform\n     * @return the transformed name\n     */\n    private String convertUsingFileNamingConvention(String originalName) {\n        String name = this.removeModelPrefixSuffix(originalName);\n        if (\"kebab-case\".equals(fileNaming)) {\n            name = dashize(underscore(name));\n        } else {\n            name = camelize(name, LOWERCASE_FIRST_LETTER);\n        }\n        return name;","sourceCodeStart":709,"sourceCodeEnd":745,"githubUrl":"https://github.com/OpenAPITools/openapi-generator/blob/fcec517be3cf5b7964296bcba25fbc97541484e7/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java#L709-L745","documentation":"fileNaming for the Angular generator accepts exactly 'camelCase' or 'kebab-case' (unlike some other TypeScript generators it has no PascalCase support). An unsupported value throws during option processing.","triggerScenarios":"-DfileNaming=PascalCase, snake_case, or any string other than the two accepted values.","commonSituations":"Copying fileNaming options from the typescript-fetch generator (which supports PascalCase) into an Angular job; assuming snake_case is available because it is common in other tools.","solutions":["Set fileNaming to 'camelCase' or 'kebab-case'.","If PascalCase file names are required, use a generator that supports it (e.g. typescript-fetch) or post-process the output."],"exampleFix":"# before\nopenapi-generator generate -g typescript-angular -i api.yaml -DfileNaming=PascalCase\n\n# after\nopenapi-generator generate -g typescript-angular -i api.yaml -DfileNaming=kebab-case","handlingStrategy":"validation","validationCode":"// node: Angular accepts only these two file naming values\nconst NAMING = ['camelCase', 'kebab-case'];\nif (opts.fileNaming && !NAMING.includes(opts.fileNaming))\n  throw new Error(`fileNaming must be one of ${NAMING.join('|')}`);","typeGuard":"const isAngularFileNaming = (v: string): v is 'camelCase' | 'kebab-case' =>\n  v === 'camelCase' || v === 'kebab-case';","tryCatchPattern":"// Java\ntry { new DefaultGenerator().opts(input).generate(); }\ncatch (IllegalArgumentException e) {\n    // unsupported naming value: switch to camelCase/kebab-case and rerun\n}","preventionTips":["Do not share fileNaming options between different TypeScript generators.","Keep a per-generator allowlist of option values in the pipeline.","Prefer kebab-case for Angular file names to match CLI conventions."],"tags":["typescript","angular","configuration","naming"],"backgroundTag":"invalid-option-value","analyzedSha":"fcec517be3cf5b7964296bcba25fbc97541484e7","analyzedAt":"2026-08-22T11:13:11.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}