OpenAPITools/openapi-generator · error · IllegalArgumentException

filter not supported :[{filterName}:{filterValue}]

Error message

filter not supported :[{filterName}:{filterValue}]

What it means

BaseFilter.doParse() matches each parsed key against the filter's filteringMethods() set; unrecognized keys fall through to parse(filterKey, filterValue), whose default implementation parseFails() throws this IllegalArgumentException. So the key is syntactically fine but not one this filter supports: Filter accepts operationId|method|tag|path, SecuritySchemesFilter accepts key|type. Custom subclasses support more only by overriding parse().

Source

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

                    .collect(Collectors.toCollection(HashSet::new));
        }

        /**
         * Parse non default filtering methods.
         *
         * Override this method to add custom parsing logic.
         *
         * By default throws IllegalArgumentException.
         *
         * @param filterName name of the filter
         * @param filterValue value of the filter
         */
        protected void parse(String filterName, String filterValue) {
            parseFails(filterName, filterValue);
        }

        protected void parseFails(String filterName, String filterValue) {
            throw new IllegalArgumentException("filter not supported :[" + filterName + ":" + filterValue + "]");
        }

        protected boolean logIfMatch(String filterName, String subjectId, boolean filterMatched) {
            if (filterMatched) {
                logMatch(filterName, subjectId);
            }
            return filterMatched;
        }

        protected abstract void logMatch(String filterName, String subjectId);

        protected Logger getLogger() {
            return OpenAPINormalizer.LOGGER;
        }
    }

    // Filter for API operations
    protected static class Filter extends BaseFilter {

View on GitHub (pinned to fcec517be3)

Solutions

  1. Use only supported keys: FILTER → operationId, method, tag, path; SECURITY_SCHEMES_FILTER → key, type.
  2. If you need an unsupported key, subclass BaseFilter/Filter and override parse(String, String) to handle custom keys.
  3. Check the usage message included in the wrapped parse() error for the exact key list.
  4. Remove the unsupported segment from the option.

Example fix

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

Strategy: validation

Validate before calling

Set<String> FILTER_KEYS = Set.of("operationId", "method", "tag", "path");
Set<String> SEC_KEYS = Set.of("key", "type");
boolean keysValid(String value, Set<String> allowed) {
    return Arrays.stream(value.split(";"))
            .map(seg -> seg.split(":")[0].trim())
            .allMatch(allowed::contains);
}

Try / catch

Catch IllegalArgumentException at config load; map the unsupported key to the allowed key list in the error shown to the user.

Prevention

When it happens

Trigger: FILTER=operations:get (key should be 'operationId'); FILTER=httpMethod:get (should be 'method'); SECURITY_SCHEMES_FILTER=name:petstore (should be 'key'); FILTER=model:Pet (no such key for operation filters at all).

Common situations: Guessing filter key names instead of copying the documented ones; reusing a key from a different tool (e.g. 'verb' for 'method'); assuming model/schema filtering exists in FILTER when it only filters operations.

Related errors


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