OpenAPITools/openapi-generator · error · IllegalArgumentException

filter with no value not supported :[{filter}]

Error message

filter with no value not supported :[{filter}]

What it means

BaseFilter.doParse() splits each ';'-separated segment on ':' and requires exactly 2 parts — one key and one value. A segment with no colon, or with more than one colon (e.g. 'path:/v1:extra'), throws this IllegalArgumentException. It propagates through parse() (error 22) which prepends the usage message. Note that a trailing colon with empty value ('method:') is accepted since split yields 2 parts; only != 2 parts fails.

Source

Thrown at modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java:2495

                // Workaround: fix the syntax!
                throw new IllegalArgumentException(message);
            }
        }

        // Defines the filtering methods supported by the filter.
        // Can be overridden by child classes to customize filtering.
        public abstract Set<String> filteringMethods();

        // Defines the usage message for the filter. This is used for logging purposes when the filter syntax is incorrect.
        public abstract String usageMessage();

        private void doParse() {
            Set<String> filteringMethods = filteringMethods();
            for (String filter : input.split(";")) {
                filter = filter.trim();
                String[] filterStrs = filter.split(":");
                if (filterStrs.length != 2) { // only support filter with : at the moment
                    throw new IllegalArgumentException("filter with no value not supported :[" + filter + "]");
                } else {
                    String filterKey = filterStrs[0].trim();
                    String filterValue = filterStrs[1];
                    Set<String> parsedFilters = splitByPipe(filterValue);
                    hasFilter = true;

                    boolean found = false;
                    for (String method : filteringMethods) {
                        if (method.equals(filterKey)) {
                            found = true;
                            filteringMethodsMap.put(filterKey, parsedFilters);
                            break;
                        }
                    }
                    if (!found) {
                        parse(filterKey, filterValue);
                    }
                }

View on GitHub (pinned to fcec517be3)

Solutions

  1. Add the missing filter key: 'method:get|post' not 'get|post'.
  2. Remove extra ':' characters from the segment — only one separator between key and values is allowed.
  3. Drop trailing ';' at the end of the option value to avoid empty segments.
  4. Verify against the usage message emitted with the wrapped error.

Example fix

# before
--openapi-normalizer "FILTER=get|post"
# after
--openapi-normalizer "FILTER=method:get|post"
Defensive patterns

Strategy: validation

Validate before calling

// Each ';'-separated segment must contain exactly one ':'
boolean ok = Arrays.stream(value.split(";"))
        .map(String::trim)
        .allMatch(seg -> seg.split(":", -1).length == 2 && !seg.isEmpty());

Try / catch

Catch IllegalArgumentException, echo the offending segment, prompt for corrected syntax — configuration error, no retry value.

Prevention

When it happens

Trigger: FILTER=get|post (missing 'method:' prefix); FILTER=path:/v1:/v2 (second colon); SECURITY_SCHEMES_FILTER=type (bare key); stray ';' producing an empty/garbage segment like 'FILTER=method:get;'.

Common situations: Users writing filter values as bare lists without the key prefix; pasting values containing Windows drive letters or URL schemes that add a second ':'; split-by-';' leaving an empty trailing segment after a trailing semicolon — note empty trailing segment splits to [''] length 1 and throws.

Related errors


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