OpenAPITools/openapi-generator · error · IllegalArgumentException

Invalid model property naming '%s'. Must be one of %s.

Error message

Invalid model property naming '%s'. Must be one of %s.

What it means

Error "Invalid model 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:883

            throw new RuntimeException("Empty method name (operationId) not allowed");
        }

        operationId = camelize(sanitizeName(operationId), LOWERCASE_FIRST_LETTER);
        operationId = toSafeIdentifier(operationId);

        return operationId;
    }

    public void setModelPropertyNaming(String naming) {
        try {
            modelPropertyNaming = MODEL_PROPERTY_NAMING_TYPE.valueOf(naming);
        } catch (IllegalArgumentException e) {
            String values = Stream.of(MODEL_PROPERTY_NAMING_TYPE.values())
                    .map(value -> "'" + value.name() + "'")
                    .collect(Collectors.joining(", "));

            String msg = String.format(Locale.ROOT, "Invalid model property naming '%s'. Must be one of %s.", naming, values);
            throw new IllegalArgumentException(msg);
        }
    }

    public void setParamNaming(String naming) {
        try {
            paramNaming = PARAM_NAMING_TYPE.valueOf(naming);
        } catch (IllegalArgumentException e) {
            String values = Stream.of(PARAM_NAMING_TYPE.values())
                    .map(value -> "'" + value.name() + "'")
                    .collect(Collectors.joining(", "));

            String msg = String.format(Locale.ROOT, "Invalid parameter naming '%s'. Must be one of %s.", naming, values);
            throw new IllegalArgumentException(msg);
        }
    }

    private String getNameUsingParamNaming(String name) {
        switch (getParamNaming()) {

View on GitHub (pinned to fcec517be3)

Solutions

  1. Set the additional property modelPropertyNaming to one of the allowed values listed in the message (e.g. '--additional-properties modelPropertyNaming=original').

When it happens

Trigger: Thrown when the 'modelPropertyNaming' option passed to a TypeScript client generator is not one of the allowed naming styles (e.g. original, camelCase, PascalCase, snake_case). Check the --additional-properties modelPropertyNaming value against the generator's supported options.

Common situations: See trigger scenarios.


AI-assisted analysis of OpenAPITools/openapi-generator@fcec517be3 (2026-08-22). Data as JSON: /api/errors/cf35748b440bea14. Report an issue: GitHub.