OpenAPITools/openapi-generator · error · IllegalArgumentException
Invalid enum property naming '%s'. Must be one of %s.
Error message
Invalid enum property naming '%s'. Must be one of %s.
What it means
Error "Invalid enum property naming '%s'. Must be one of %s." thrown in OpenAPITools/openapi-generator.
Source
Thrown at modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java:1013
}
@Override
public String toEnumName(CodegenProperty property) {
String enumName = property.name;
enumName = addSuffix(enumName, enumSuffix);
return toTypescriptTypeName(enumName, "_");
}
protected void setEnumPropertyNaming(String naming) {
try {
enumPropertyNaming = ENUM_PROPERTY_NAMING_TYPE.valueOf(naming);
} catch (IllegalArgumentException e) {
String values = Stream.of(ENUM_PROPERTY_NAMING_TYPE.values())
.map(value -> "'" + value.name() + "'")
.collect(Collectors.joining(", "));
String msg = String.format(Locale.ROOT, "Invalid enum property naming '%s'. Must be one of %s.", naming, values);
throw new IllegalArgumentException(msg);
}
}
protected ENUM_PROPERTY_NAMING_TYPE getEnumPropertyNaming() {
return enumPropertyNaming;
}
protected void setEnumPropertyNamingReplaceSpecialChar(boolean replaceSpecialChars) {
enumPropertyNamingReplaceSpecialChar = replaceSpecialChars;
}
protected boolean isEnumPropertyNamingReplaceSpecialChar() {
return enumPropertyNamingReplaceSpecialChar;
}
private String getNameUsingEnumPropertyNaming(String name) {
switch (getEnumPropertyNaming()) {
case original:View on GitHub (pinned to fcec517be3)
Solutions
- Set the additional property enumPropertyNaming to one of the allowed values listed in the message.
When it happens
Trigger: Thrown when the 'enumPropertyNaming' option passed to a TypeScript client generator is not one of the allowed naming styles. Check the --additional-properties enumPropertyNaming value.
Common situations: See trigger scenarios.
AI-assisted analysis of OpenAPITools/openapi-generator@fcec517be3 (2026-08-22).
Data as JSON: /api/errors/5e5b6eb01dd12c10.
Report an issue: GitHub.