{"record":{"id":"3d9418a09cd504cb","repo":"OpenAPITools/openapi-generator","slug":"empty-method-operation-name-operationid-not-allo-3d9418","errorCode":null,"errorMessage":"Empty method/operation name (operationId) not allowed","messagePattern":"Empty method/operation name \\(operationId\\) not allowed","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java","lineNumber":339,"sourceCode":"\n    @Override\n    public String getSchemaType(Schema p) {\n        String schemaType = super.getSchemaType(p);\n        String type = null;\n        if (typeMapping.containsKey(schemaType)) {\n            type = typeMapping.get(schemaType);\n            if (languageSpecificPrimitives.contains(type))\n                return (type);\n        } else\n            type = schemaType;\n        return type;\n    }\n\n    @Override\n    public String toOperationId(String operationId) {\n        // throw exception if method name is empty\n        if (StringUtils.isEmpty(operationId)) {\n            throw new RuntimeException(\"Empty method/operation name (operationId) not allowed\");\n        }\n\n        String sanitizedOperationId = camelize(sanitizeName(operationId), LOWERCASE_FIRST_LETTER);\n\n        // method name cannot use reserved keyword, e.g. return\n        if (isReservedWord(sanitizedOperationId)) {\n            LOGGER.warn(\"{} (reserved word) cannot be used as method name. Renamed to {}\", operationId, camelize(\"call_\" + operationId));\n            sanitizedOperationId = \"call_\" + sanitizedOperationId;\n        }\n\n        // operationId starts with a number\n        if (operationId.matches(\"^\\\\d.*\")) {\n            LOGGER.warn(operationId + \" (starting with a number) cannot be used as method sname. Renamed to \" + camelize(\"call_\" + operationId), true);\n            sanitizedOperationId = camelize(\"call_\" + sanitizedOperationId, LOWERCASE_FIRST_LETTER);\n        }\n\n        // method name from updateSomething to update_Something.\n        sanitizedOperationId = unCamelize(sanitizedOperationId);","sourceCodeStart":321,"sourceCodeEnd":357,"githubUrl":"https://github.com/OpenAPITools/openapi-generator/blob/fcec517be3cf5b7964296bcba25fbc97541484e7/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java#L321-L357","documentation":"AbstractEiffelCodegen.toOperationId throws when the operation name reaching it is null or empty. Eiffel feature names are generated from operationId and cannot be empty, so the run aborts. Default operationId derivation normally fills blanks from path+method, so an explicitly empty value or a bypassing code path is required to hit this.","triggerScenarios":"A spec operation with 'operationId: \"\"' where default derivation is bypassed, or a custom generator calling toOperationId directly with a blank id.","commonSituations":"Machine-converted specs that drop operationIds; hand-edited specs with blank ids; generator subclasses on AbstractEiffelCodegen that preprocess ids.","solutions":["Provide a unique non-empty operationId for every operation.","Remove the empty operationId key so default path-based naming applies.","Check any custom Eiffel generator override that could forward an empty string."],"exampleFix":"# before:\npaths:\n  /things:\n    post:\n      operationId: ''\n# after:\npaths:\n  /things:\n    post:\n      operationId: createThing","handlingStrategy":"validation","validationCode":"// Pre-flight: every operation must have a non-empty operationId\nOpenAPI api = new OpenAPIV3Parser().read(\"spec.yaml\");\napi.getPaths().forEach((path, item) -> item.readOperationsMap().forEach((method, op) -> {\n    String id = op.getOperationId();\n    if (id == null || id.trim().isEmpty())\n        throw new IllegalStateException(method + \" \" + path + \" has an empty operationId\");\n}));","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Give every operation an explicit operationId in the source spec.","Strip empty operationId keys in a spec cleanup step before generation.","Validate converted specs (Postman/other) for blank operationIds."],"tags":["openapi","operationid","eiffel","code-generation"],"backgroundTag":"missing-operation-id","analyzedSha":"fcec517be3cf5b7964296bcba25fbc97541484e7","analyzedAt":"2026-08-22T11:13:11.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}