{"record":{"id":"e8b19ba788ecbaba","repo":"OpenAPITools/openapi-generator","slug":"the-s-documentation-provider-is-not-supported-b-e8b19b","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/KotlinSpringServerCodegen.java","lineNumber":530,"sourceCode":"                || (additionalProperties.containsKey(USE_SPRING_BOOT4)\n                    && convertPropertyToBoolean(USE_SPRING_BOOT4));\n        if (springBoot4Enabled) {\n            additionalProperties.put(USE_JACKSON_3, \"true\");\n        }\n\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":512,"sourceCodeEnd":548,"githubUrl":"https://github.com/OpenAPITools/openapi-generator/blob/fcec517be3cf5b7964296bcba25fbc97541484e7/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java#L512-L548","documentation":"kotlin-spring supports only the 'none', 'source' and 'springdoc' documentation providers (see supportedDocumentationProvider() at KotlinSpringServerCodegen.java:433). During processOpts() the CLI value is parsed with DocumentationProvider.ofCliOption() and rejected with an IllegalArgumentException if the parsed provider is valid for other generators but not for this one. The parser upper-cases the input, so provider values are case-insensitive, but 'swagger1'/'swagger2' — although valid enum constants — are not offered by kotlin-spring.","triggerScenarios":"Running `-g kotlin-spring` with `--additional-properties documentationProvider=swagger1` or `documentationProvider=swagger2` (valid DocumentationProvider values that kotlin-spring does not support). Note: a completely unknown string like 'swagger' fails earlier, inside DocumentationProvider.ofCliOption()'s valueOf(), with a different 'No enum constant' message.","commonSituations":"Copy-pasting generator options from a java-spring project (which does support swagger2) into a kotlin-spring build; migrating Maven/Gradle plugin configOptions between the Java and Kotlin Spring generators; trying to use Swagger-Core UI instead of springdoc.","solutions":["Use `documentationProvider=springdoc` (the default for kotlin-spring) or `source`/`none`.","If you specifically need swagger2/swagger-core generated specs, switch to `-g java-spring` (SpringCodegen supports those providers).","Run `openapi-generator-cli config-help -g kotlin-spring` to list the documentationProvider values this generator actually accepts before setting them."],"exampleFix":"# before\nopenapi-generator-cli generate -g kotlin-spring -i api.yaml \\\n  --additional-properties documentationProvider=swagger2\n# after\nopenapi-generator-cli generate -g kotlin-spring -i api.yaml \\\n  --additional-properties documentationProvider=springdoc","handlingStrategy":"validation","validationCode":"// allow-list mirrors supportedDocumentationProvider() for kotlin-spring\nSet<String> supported = Set.of(\"NONE\", \"SOURCE\", \"SPRINGDOC\");\nString dp = String.valueOf(opts.getOrDefault(\"documentationProvider\", \"SPRINGDOC\"))\n        .toUpperCase(Locale.ROOT);\nif (!supported.contains(dp)) {\n    throw new IllegalArgumentException(\n        \"kotlin-spring documentationProvider must be one of \" + supported);\n}","typeGuard":null,"tryCatchPattern":"try {\n    new DefaultGenerator().opts(clientOptInput).generate();\n} catch (IllegalArgumentException e) {\n    // e.getMessage() names the unsupported provider; map it to the supported set for the user\n    throw new BuildException(\"Invalid kotlin-spring options: \" + e.getMessage(), e);\n}","preventionTips":["Run `openapi-generator-cli config-help -g kotlin-spring` and copy enumerated values verbatim.","Never port java-spring configOptions to kotlin-spring without diffing the supported lists.","Pin the generator version and record the validated option set next to it in the repo."],"tags":["kotlin","spring","documentation-provider","springdoc","additional-properties","openapi-generator","config-validation"],"backgroundTag":"unsupported-option-value","analyzedSha":"fcec517be3cf5b7964296bcba25fbc97541484e7","analyzedAt":"2026-08-22T11:13:11.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}