{"record":{"id":"8ac861832592c07d","repo":"OpenAPITools/openapi-generator","slug":"the-s-documentation-provider-is-not-supported-b","errorCode":null,"errorMessage":"The [%s] Documentation Provider is not supported by this generator","messagePattern":"The \\[(.+?)\\] Documentation Provider is not supported by this generator","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java","lineNumber":424,"sourceCode":"        cliOptions.add(CliOption.newString(CodegenConstants.DEFAULT_TO_EMPTY_CONTAINER, CodegenConstants.DEFAULT_TO_EMPTY_CONTAINER_DESC));\n    }\n\n    @Override\n    public void processOpts() {\n        useCodegenAsMustacheParentContext();\n        super.processOpts();\n\n        if (null != defaultDocumentationProvider()) {\n            documentationProvider = DocumentationProvider.ofCliOption(\n                    (String) additionalProperties.getOrDefault(DOCUMENTATION_PROVIDER,\n                            defaultDocumentationProvider().toCliOptValue())\n            );\n\n            if (!supportedDocumentationProvider().contains(documentationProvider)) {\n                String msg = String.format(Locale.ROOT,\n                        \"The [%s] Documentation Provider is not supported by this generator\",\n                        documentationProvider.toCliOptValue());\n                throw new IllegalArgumentException(msg);\n            }\n\n            annotationLibrary = AnnotationLibrary.ofCliOption(\n                    (String) additionalProperties.getOrDefault(ANNOTATION_LIBRARY,\n                            documentationProvider.getPreferredAnnotationLibrary().toCliOptValue())\n            );\n\n            if (!supportedAnnotationLibraries().contains(annotationLibrary)) {\n                String msg = String.format(Locale.ROOT, \"The Annotation Library [%s] is not supported by this generator\",\n                        annotationLibrary.toCliOptValue());\n                throw new IllegalArgumentException(msg);\n            }\n\n            if (!documentationProvider.supportedAnnotationLibraries().contains(annotationLibrary)) {\n                String msg = String.format(Locale.ROOT,\n                        \"The [%s] documentation provider does not support [%s] as complementary annotation library\",\n                        documentationProvider.toCliOptValue(), annotationLibrary.toCliOptValue());\n                throw new IllegalArgumentException(msg);","sourceCodeStart":406,"sourceCodeEnd":442,"githubUrl":"https://github.com/OpenAPITools/openapi-generator/blob/fcec517be3cf5b7964296bcba25fbc97541484e7/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java#L406-L442","documentation":"AbstractJavaCodegen.processOpts resolves the documentationProvider option and throws IllegalArgumentException when the value — although a valid provider (none, source, swagger1, swagger2, springdoc) — is not in the concrete generator's supportedDocumentationProvider() set. Different Java generators support different provider subsets.","triggerScenarios":"Passing -p documentationProvider=source (or springdoc, etc.) to a Java generator whose supportedDocumentationProvider() excludes it. The value is resolved via DocumentationProvider.ofCliOption, then the membership check fails and option processing aborts.","commonSituations":"Copying a working option set from one Java generator (spring, jaxrsjersey) to another that supports only swagger2 or springdoc; upgrading generator versions where the supported set changed; typos usually produce a different 'No enum constant' error, so this one means a valid-but-unsupported combination.","solutions":["Pick a documentation provider the specific generator supports — check the generator's README/help output for documentationProvider values.","Omit the documentationProvider option to fall back to the generator's defaultDocumentationProvider().","Switch to a generator that supports the provider you need if the documentation output is a hard requirement."],"exampleFix":"# before (generator only supports springdoc):\nopenapi-generator-cli generate -g java -i api.yaml -p documentationProvider=source\n# after:\nopenapi-generator-cli generate -g java -i api.yaml -p documentationProvider=springdoc\n# or simply omit the option to use the default","handlingStrategy":"validation","validationCode":"// Programmatic use: verify against the generator instance before setting options\nJavaGenerator gen = ...; // concrete generator\nString provider = (String) additionalProperties.getOrDefault(\"documentationProvider\",\n        gen.defaultDocumentationProvider().toCliOptValue());\nDocumentationProvider parsed = DocumentationProvider.ofCliOption(provider.toUpperCase(Locale.ROOT));\nif (!gen.supportedDocumentationProvider().contains(parsed))\n    throw new IllegalArgumentException(\"Pick from: \" + gen.supportedDocumentationProvider());","typeGuard":"const DOC_PROVIDERS = ['none', 'source', 'swagger1', 'swagger2', 'springdoc'] as const;\nexport type DocProvider = typeof DOC_PROVIDERS[number];\nexport function isDocProvider(v: string): v is DocProvider {\n    return (DOC_PROVIDERS as readonly string[]).includes(v);\n}\n// NOTE: passing the guard is necessary but not sufficient — the concrete generator's supported set decides.","tryCatchPattern":null,"preventionTips":["Check each generator's supported documentationProvider list (generator README/help) instead of assuming all Java generators are alike.","Omit the option when unsure; the generator's defaultDocumentationProvider() is always supported.","Keep generator-specific option sets in separate config files rather than one shared template."],"tags":["openapi","java","documentation-provider","configuration"],"backgroundTag":"unsupported-generator-option","analyzedSha":"fcec517be3cf5b7964296bcba25fbc97541484e7","analyzedAt":"2026-08-22T11:13:11.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}