OpenAPITools/openapi-generator · error · ResponseStatusException

In rule: " + rule + "the operands were not provided in the f

Error message

In rule: " + rule + "the operands were not provided in the form of <Rule>=<Value>

What it means

Thrown when an entry of the optional openapiNormalizer list does not split on '=' into exactly two parts (Generator.java:136-141). Each rule must be the single string form <Rule>=<Value>, e.g. RESOLVE_INLINE_MODELS=true. Note the implementation uses rule.split("="); a value that itself contains '=' produces three parts and is rejected too, so both 'RULE' (no '=') and 'RULE=a=b' fail.

Source

Thrown at modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/service/Generator.java:140

        clientOptInput.openAPI(openapi);

        CodegenConfig codegenConfig;
        try {
            codegenConfig = CodegenConfigLoader.forName(language);
        } catch (RuntimeException e) {
            throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Unsupported target " + language + " supplied");
        }

        if (opts.getOptions() != null) {
            codegenConfig.additionalProperties().putAll(opts.getOptions());
            codegenConfig.additionalProperties().put("openAPI", openapi);
        }

        if (opts.getOpenapiNormalizer() != null && !opts.getOpenapiNormalizer().isEmpty()) {
            for (String rule : opts.getOpenapiNormalizer()) {
                String[] ruleOperands = rule.split("=");
                if (ruleOperands.length != 2) {
                    throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "In rule: " + rule + "the operands were not provided in the form of <Rule>=<Value>");
                }
                codegenConfig.openapiNormalizer().put(ruleOperands[0], ruleOperands[1]);
            }
        }

        codegenConfig.setOutputDir(outputFolder);

        clientOptInput.config(codegenConfig);

        try {
            List<File> files = new DefaultGenerator().opts(clientOptInput).generate();
            if (files.size() > 0) {
                List<File> filesToAdd = new ArrayList<>();
                LOGGER.debug("adding to {}", outputFolder);
                filesToAdd.add(new File(outputFolder));
                ZipUtil zip = new ZipUtil();
                zip.compressFiles(filesToAdd, outputFilename);
            } else {

View on GitHub (pinned to fcec517be3)

Solutions

  1. Send every rule as one 'Rule=Value' string: ["RESOLVE_INLINE_MODELS=true","KEEP_ONLY_FIRST_TAG_IN_OPERATION=false"]
  2. Ensure values contain no '=' themselves, and each rule is its own array element
  3. Use only documented rule names from the openapi-normalizer docs (e.g. RESOLVE_INLINE_MODELS, KEEP_ONLY_FIRST_TAG_IN_OPERATION, REMOVE_ANYOF_ONEOF, REFACTOR_ALLOF)

Example fix

// before
in.setOpenapiNormalizer(List.of("RESOLVE_INLINE_MODELS"));   // 400 In rule: RESOLVE_INLINE_MODELS the operands ...

// after
in.setOpenapiNormalizer(List.of("RESOLVE_INLINE_MODELS=true"));
Defensive patterns

Strategy: validation

Validate before calling

// enforce the exact 'Rule=Value' shape before posting
private static final Pattern RULE = Pattern.compile("^[^=]+=[^=]*$");
for (String r : normalizerRules) {
    if (!RULE.matcher(r).matches()) throw new IllegalArgumentException("bad rule '" + r + "', expected <Rule>=<Value>");
}

Type guard

boolean isValidNormalizerRule(String r) {
    return r != null && r.split("=", -1).length == 2; // mirrors server: exactly one '='
}

Prevention

When it happens

Trigger: Sending "openapiNormalizer": ["RESOLVE_INLINE_MODELS"] without '=true'; passing a JSON object or list of objects instead of the string array; values containing '=' ("KEEP_ONLY_FIRST_TAG_IN_OPERATION=a=b"); stray whitespace/glue characters between rules joined into one string.

Common situations: Porting CLI-style flags (--resolve-inline-models) directly into the API body; config files mapping rules to booleans that get serialized as objects; hand-editing the request JSON and dropping the '=value' suffix.

Related errors


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