OpenAPITools/openapi-generator · error · RuntimeException
{} is an invalid enum property naming option. Please choose
Error message
{} is an invalid enum property naming option. Please choose from: What it means
XojoClientCodegen.setSerializationLibrary (line 708) parses the 'serializationLibrary' option with enum valueOf against SERIALIZATION_LIBRARY_TYPE, which contains exactly one constant: 'xoson' (line 52). Any other string throws a RuntimeException listing the valid values. Note the message text ('invalid enum property naming option') is a copy-paste artifact — it really refers to the serialization library, and the parse is case-sensitive, so 'XOSON' also fails.
Source
Thrown at modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/XojoClientCodegen.java:708
codegenParameter.example = "New Dictionary";
}
}
/**
* Sets the serialization engine for Xojo
*
* @param enumSerializationLibrary The string representation of the serialization library as defined by
* {@link org.openapitools.codegen.languages.XojoClientCodegen.SERIALIZATION_LIBRARY_TYPE}
*/
public void setSerializationLibrary(final String enumSerializationLibrary) {
try {
this.serializationLibrary = SERIALIZATION_LIBRARY_TYPE.valueOf(enumSerializationLibrary);
} catch (IllegalArgumentException ex) {
StringBuilder sb = new StringBuilder(enumSerializationLibrary + " is an invalid enum property naming option. Please choose from:");
for (SERIALIZATION_LIBRARY_TYPE t : SERIALIZATION_LIBRARY_TYPE.values()) {
sb.append("\n ").append(t.name());
}
throw new RuntimeException(sb.toString());
}
}
private String getDefaultPropertyValue(Schema schema) {
if (ModelUtils.isBooleanSchema(schema)) {
return "False";
} else if (ModelUtils.isDateSchema(schema)) {
return "Nil";
} else if (ModelUtils.isDateTimeSchema(schema)) {
return "Nil";
} else if (ModelUtils.isNumberSchema(schema)) {
return "0";
} else if (ModelUtils.isIntegerSchema(schema)) {
return "0";
} else if (ModelUtils.isStringSchema(schema)) {
return "Sample";
} else if (ModelUtils.isObjectSchema(schema)) {
return "Nil";View on GitHub (pinned to fcec517be3)
Solutions
- Drop the serializationLibrary option for Xojo — 'xoson' is the default and only choice.
- Or pass the exact lowercase value: -DserializationLibrary=xoson (valueOf is case-sensitive).
- Read the appended list in the thrown message; it enumerates every accepted constant.
Example fix
# before openapi-generator-cli generate -g xojo-client \ -DserializationLibrary=XML # after openapi-generator-cli generate -g xojo-client # (xoson is the default; or pass -DserializationLibrary=xoson)
Defensive patterns
Strategy: validation
Validate before calling
if [ -n "$SERIALIZATION_LIBRARY" ] && [ "$SERIALIZATION_LIBRARY" != "xoson" ]; then echo "ERROR: xojo only supports serializationLibrary=xoson (case-sensitive)" >&2 exit 1 fi
Type guard
const XOJO_SERIALIZATION_LIBRARIES = ['xoson'] as const; type XojoSerializationLibrary = typeof XOJO_SERIALIZATION_LIBRARIES[number]; const isXojoSerializationLibrary = (v: string): v is XojoSerializationLibrary => (XOJO_SERIALIZATION_LIBRARIES as readonly string[]).includes(v);
Prevention
- Don't blanket-set serializationLibrary across all generators in one script — each has its own allowed set (Xojo: only lowercase 'xoson').
- Check the error's appended value list; it is authoritative per generator.
When it happens
Trigger: Passing -DserializationLibrary=json, -DserializationLibrary=XML (copied from the java generator), or even -DserializationLibrary=XOSON with wrong casing. Xojo currently only supports its native Xoson DTO serialization.
Common situations: Shared generation scripts that set serializationLibrary for many target languages; upgrading from generators where this option is meaningful; users who don't realize xoson is the only and default value.
Related errors
- useJackson3 is only available with Spring Boot >= 4
- %s file suffix only allows '.', '-' and alphanumeric charact
- %s class suffix only allows alphanumeric characters.
- Invalid file naming '{}'. Must be 'camelCase' or 'kebab-case
- %s file suffix only allows '.', '-' and alphanumeric charact
AI-assisted analysis of OpenAPITools/openapi-generator@fcec517be3 (2026-08-22).
Data as JSON: /api/errors/5289f6ebc359ac00.
Report an issue: GitHub.