{"record":{"id":"86e875bccab3c3d9","repo":"OpenAPITools/openapi-generator","slug":"the-pattern-is-invalid","errorCode":null,"errorMessage":"The pattern *** is invalid.","messagePattern":"The pattern \\*\\*\\* is invalid\\.","errorType":"exception","errorClass":"ParserException","httpStatus":null,"severity":"error","filePath":"modules/openapi-generator/src/main/java/org/openapitools/codegen/ignore/rules/IgnoreLineParser.java","lineNumber":91,"sourceCode":"                    }\n                } else if (\"\\\\\".equals(current) && \"#\".equals(next)) {\n                    //: Put a backslash (\"`\\`\") in front of the first hash for patterns\n                    //: that begin with a hash.\n                    // NOTE: Just push forward and drop the escape character. Falls through to TEXT token.\n                    current = next;\n                    next = null;\n                    i++;\n                }\n            }\n\n            if (Token.MATCH_ANY.pattern.equals(current)) {\n\n                if (Token.MATCH_ANY.pattern.equals(next)) {\n                    // peek ahead for invalid pattern. Slightly inefficient, but acceptable.\n                    if ((i + 2 < totalLength - 1) &&\n                            String.valueOf(characters[i + 2]).equals(Token.MATCH_ANY.pattern)) {\n                        // It doesn't matter where we are in the pattern, *** is invalid.\n                        throw new ParserException(\"The pattern *** is invalid.\");\n                    }\n\n                    parts.add(new Part(Token.MATCH_ALL));\n                    i++;\n                    continue;\n                } else {\n\n                    if (sb.length() > 0) {\n                        // A MATCH_ANY may commonly follow a filename or some other character. Dump that to results before the MATCH_ANY.\n                        parts.add(new Part(Token.TEXT, sb.toString()));\n                        sb.delete(0, sb.length());\n                    }\n\n                    parts.add(new Part(Token.MATCH_ANY));\n                    continue;\n                }\n            }\n","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/OpenAPITools/openapi-generator/blob/fcec517be3cf5b7964296bcba25fbc97541484e7/modules/openapi-generator/src/main/java/org/openapitools/codegen/ignore/rules/IgnoreLineParser.java#L73-L109","documentation":"IgnoreLineParser throws ParserException when a pattern in .openapi-generator-ignore contains three consecutive '*' characters ('***'). In gitignore-style syntax only single '*' and double '**' are meaningful, so '***' is rejected rather than silently mis-matching.","triggerScenarios":"A line in .openapi-generator-ignore such as '***/*.java' or '/src/***' — the parser peeks ahead from a '**' and, on finding a third '*', throws before generation starts.","commonSituations":"Typo where '**' was meant; patterns copied from another tooling ecosystem whose globs tolerate '***'; find/replace edits that collapsed two patterns together.","solutions":["Replace '***' with '**' in the offending pattern.","If the literal filename really contains '***', escape each star with a backslash (e.g. \\*\\*\\*).","Re-check the whole file — parsing stops at the first invalid line, so more may follow."],"exampleFix":"# .openapi-generator-ignore (before):\n***/generated/**\n# after:\n**/generated/**","handlingStrategy":"validation","validationCode":"// Pre-flight: lint .openapi-generator-ignore before generation\nfor (String line : Files.readAllLines(Paths.get(outputDir, \".openapi-generator-ignore\"))) {\n    if (line.contains(\"***\"))\n        throw new IllegalStateException(\"Invalid ignore pattern (*** not allowed): \" + line);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember only * and ** are meaningful in openapi-generator ignore patterns.","Escape literal stars with backslashes when a filename genuinely contains them.","Lint the ignore file in CI alongside the spec so glob typos fail before generation."],"tags":["ignore-file","parser","glob","openapi-generator-ignore"],"backgroundTag":"invalid-ignore-pattern","analyzedSha":"fcec517be3cf5b7964296bcba25fbc97541484e7","analyzedAt":"2026-08-22T11:13:11.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}