{"record":{"id":"7c459af08c2e3c8e","repo":"OpenAPITools/openapi-generator","slug":"unknown-library-option-s-for-helidon-server","errorCode":null,"errorMessage":"Unknown library option %s for Helidon Server","messagePattern":"Unknown library option (.+?) for Helidon Server","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonServerCodegen.java","lineNumber":235,"sourceCode":"                importMapping.put(\"ByteArrayOutputStream\", \"java.io.ByteArrayOutputStream\");\n                importMapping.put(\"DataChunk\", \"io.helidon.common.http.DataChunk\");\n                importMapping.put(\"UncheckedIOException\", \"java.io.UncheckedIOException\");\n                importMapping.put(\"IOException\", \"java.io.IOException\");\n                importMapping.put(\"ByteArrayInputStream\", \"java.io.ByteArrayInputStream\");\n            }\n            importMapping.put(\"Map\", \"java.util.Map\");\n            importMapping.put(\"ReadableBodyPart\",  // use the old ReadableBodyPart name for backward compatibility\n                    (helidonMajorVersion <= 3)\n                            ? \"io.helidon.media.multipart.ReadableBodyPart\"\n                            : \"io.helidon.http.media.multipart.ReadablePart\");\n            importMapping.put(\"Handler\", \"io.helidon.webserver.\" + (helidonMajorVersion != 3 ? \"http.\" : \"\") + \"Handler\");\n            importMapping.put(\"GenericType\", \"io.helidon.common.GenericType\");\n            importMapping.put(\"GenericTypes\", modelPackage + \".GenericTypes\");\n            importMapping.put(\"Optional\", \"java.util.Optional\");\n            processSupportingFiles(modifiable, unmodifiable);\n        } else {\n            LOGGER.error(\"Unknown library option (-l/--library): {}\", getLibrary());\n            throw new IllegalArgumentException(\n                    String.format(Locale.ROOT,\n                            \"Unknown library option %s for Helidon Server\",\n                            getLibrary()\n                    )\n            );\n        }\n\n        if (getSerializationLibrary() == null) {\n            LOGGER.info(\"No serializationLibrary configured, using '{}' as fallback\", SERIALIZATION_LIBRARY_JACKSON);\n            setSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON);\n        }\n        switch (getSerializationLibrary()) {\n            case SERIALIZATION_LIBRARY_JACKSON:\n                additionalProperties.put(SERIALIZATION_LIBRARY_JACKSON, \"true\");\n                additionalProperties.remove(SERIALIZATION_LIBRARY_JSONB);\n                supportingFiles.add(new SupportingFile(\"RFC3339DateFormat.mustache\", invokerFolder, \"RFC3339DateFormat.java\"));\n                if (isLibrary(HELIDON_SE)) {\n                    supportingFiles.add(new SupportingFile(\"jsonProvider.mustache\",","sourceCodeStart":217,"sourceCodeEnd":253,"githubUrl":"https://github.com/OpenAPITools/openapi-generator/blob/fcec517be3cf5b7964296bcba25fbc97541484e7/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonServerCodegen.java#L217-L253","documentation":"Thrown by JavaHelidonServerCodegen.processOpts when the selected --library is neither 'helidon-mp' nor 'helidon-se', the only two flavors the Helidon server generator implements. The else-branch fires after isLibrary(HELIDON_MP) and isLibrary(HELIDON_SE) both miss, and it logs the offending value via LOGGER.error before throwing. Note the dedicated java-helidon-server generator exists precisely to hold these two flavors; other Helidon server styles belong to different generators.","triggerScenarios":"Running -g java-helidon-server --library <default> or --library jersey (or any string). Happens when a config file written for -g jaxrs-jersey --library helidon is reused verbatim with -g java-helidon-server, or when the --library flag is simply forgotten (the generator does not default it here).","commonSituations":"Migration confusion between the JAX-RS 'jaxrs-jersey' generator (whose library list includes 'helidon') and the dedicated java-helidon-server generator (whose library values are helidon-mp/helidon-se). Copy-pasted CI commands that swap -g but keep the old --library value.","solutions":["Pick one of the two supported flavors: --library helidon-mp or --library helidon-se","If your config came from jaxrs-jersey, remove its library value and set helidon-mp or helidon-se explicitly for this generator","Check `openapi-generator-cli config-help -g java-helidon-server` for the enumerated library values before running","If you intended the JAX-RS-style Helidon server, use -g jaxrs-jersey --library helidon instead"],"exampleFix":"# before\nopenapi-generator-cli generate -g java-helidon-server -i api.yaml \\\n  --library jersey\n\n# after\nopenapi-generator-cli generate -g java-helidon-server -i api.yaml \\\n  --library helidon-se","handlingStrategy":"validation","validationCode":"Set<String> helidonServerLibs = Set.of(\"helidon-mp\", \"helidon-se\");\nString library = String.valueOf(opts.getOrDefault(\"library\", \"\"));\nif (!helidonServerLibs.contains(library)) {\n    throw new IllegalArgumentException(\"-g java-helidon-server requires --library helidon-mp|helidon-se, got: '\" + library + \"'\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    new DefaultGenerator().opts(input).generate();\n} catch (IllegalArgumentException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"Helidon Server\")) {\n        throw new ConfigurationException(\"Set --library helidon-mp or helidon-se for java-helidon-server\", e);\n    }\n    throw e;\n}","preventionTips":["Store per-generator library whitelists in your codegen wrapper and validate before invoking the CLI","When migrating between generators, re-derive --library from the new generator's config-help instead of carrying old values","Add required-option checks (like --library for java-helidon-server) to config templates"],"tags":["java","helidon","openapi-generator","code-generation","library-selection","configuration"],"backgroundTag":"unknown-library-option","analyzedSha":"fcec517be3cf5b7964296bcba25fbc97541484e7","analyzedAt":"2026-08-22T11:13:11.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}