{"record":{"id":"f0fdc34354c37693","repo":"OpenAPITools/openapi-generator","slug":"s-input-s-error-s","errorCode":null,"errorMessage":"%s Input: `%s`. Error: %s","messagePattern":"(.+?) Input: `(.+?)`\\. Error: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java","lineNumber":2478,"sourceCode":"\n        /**\n         * Perform the parsing of the filter string.\n         *\n         * @return true if filters need to be processed\n         */\n        public boolean parse() {\n            if (StringUtils.isEmpty(input)) {\n                return false;\n            }\n            try {\n                doParse();\n                return hasFilter();\n            } catch (RuntimeException e) {\n                String usage = usageMessage();\n                String message = String.format(Locale.ROOT, \"%s Input: `%s`. Error: %s\", usage, input, e.getMessage());\n                // throw an exception. This is a breaking change compared to pre 7.16.0\n                // Workaround: fix the syntax!\n                throw new IllegalArgumentException(message);\n            }\n        }\n\n        // Defines the filtering methods supported by the filter.\n        // Can be overridden by child classes to customize filtering.\n        public abstract Set<String> filteringMethods();\n\n        // Defines the usage message for the filter. This is used for logging purposes when the filter syntax is incorrect.\n        public abstract String usageMessage();\n\n        private void doParse() {\n            Set<String> filteringMethods = filteringMethods();\n            for (String filter : input.split(\";\")) {\n                filter = filter.trim();\n                String[] filterStrs = filter.split(\":\");\n                if (filterStrs.length != 2) { // only support filter with : at the moment\n                    throw new IllegalArgumentException(\"filter with no value not supported :[\" + filter + \"]\");\n                } else {","sourceCodeStart":2460,"sourceCodeEnd":2496,"githubUrl":"https://github.com/OpenAPITools/openapi-generator/blob/fcec517be3cf5b7964296bcba25fbc97541484e7/modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java#L2460-L2496","documentation":"BaseFilter.parse() wraps any RuntimeException raised while parsing a normalizer filter string and rethrows it as IllegalArgumentException with the filter's usage message, the raw input, and the underlying error. Since 7.16.0 this is a breaking change: malformed FILTER or SECURITY_SCHEMES_FILTER values now abort generation instead of being silently ignored (the source comment says 'Workaround: fix the syntax!'). The message itself is assembled from whatever inner failure occurred — typically error 23 (missing/extra colon) or 24 (unknown filter key).","triggerScenarios":"Passing --openapi-normalizer 'FILTER=operationId' (no colon), 'SECURITY_SCHEMES_FILTER=key petstore' (no colon), or any value whose segments violate the `name:value1|value2;name2:value3` grammar. Empty input returns false without error; only non-empty malformed input throws.","commonSituations":"Upgrading to >= 7.16.0 where a previously-ignored bad FILTER string now crashes builds; shell quoting mistakes (unquoted ; or | interpreted by the shell); CI configuration templates with placeholder filter values never filled in.","solutions":["Read the usage portion of the message — it states the exact accepted forms (e.g. FILTER must be `operationId:name1|name2` / `method:get|post` / `tag:t1|t2` / `path:/v1|/v2`).","Fix the reported Input segment to use exactly one ':' per filter, '|' between values, ';' between filters.","Quote the whole option in the shell so ';', '|' are not interpreted by the shell.","If the filter is optional, remove the rule entirely instead of leaving a malformed stub."],"exampleFix":"# before\n--openapi-normalizer FILTER=operationId getPet|addPet\n# after\n--openapi-normalizer \"FILTER=operationId:getPet|addPet\"","handlingStrategy":"validation","validationCode":"// Validate normalizer filter syntax before passing it to the generator\nprivate static final Pattern SEGMENT = Pattern.compile(\"^\\\\s*([A-Za-z]+)\\\\s*:[^:]*$\", Pattern.UNICODE_CHARACTER_CLASS);\nboolean valid(String filterValue) {\n    for (String seg : filterValue.split(\";\")) {\n        if (!SEGMENT.matcher(seg).matches()) return false;\n    }\n    return true;\n}","typeGuard":null,"tryCatchPattern":"Catch IllegalArgumentException at startup around generation config; fail fast with the usage message shown to the operator. Do not swallow — since 7.16.0 bad syntax is intentionally fatal.","preventionTips":["Centralize normalizer options in one config file instead of ad-hoc CLI flags.","Always shell-quote values containing ';' and '|'.","Write a unit test asserting your configured FILTER/SECURITY_SCHEMES_FILTER strings parse (instantiate the normalizer filter in a test)."],"tags":["openapi","normalizer","filter-syntax","configuration","illegal-argument"],"backgroundTag":"invalid-configuration-syntax","analyzedSha":"fcec517be3cf5b7964296bcba25fbc97541484e7","analyzedAt":"2026-08-22T11:13:11.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}