{"record":{"id":"624f8d442f67bad0","repo":"OpenAPITools/openapi-generator","slug":"unexpected-serializationlibrary-value-serializat-624f8d","errorCode":null,"errorMessage":"Unexpected serializationLibrary value: {serializationLibrary}","messagePattern":"Unexpected serializationLibrary value: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonServerCodegen.java","lineNumber":485,"sourceCode":"    @Override\n    public String getHelp() {\n        return \"Generates a Java Helidon Server application.\";\n    }\n\n    @Override\n    public void setPerformBeanValidation(boolean performBeanValidation) {\n        throw new UnsupportedOperationException(\"Not implemented\");\n    }\n\n    public void setSerializationLibrary(String serializationLibrary) {\n        if (SERIALIZATION_LIBRARY_JACKSON.equalsIgnoreCase(serializationLibrary)) {\n            this.serializationLibrary = SERIALIZATION_LIBRARY_JACKSON;\n            this.jackson = true;\n        } else if (SERIALIZATION_LIBRARY_JSONB.equalsIgnoreCase(serializationLibrary)) {\n            this.serializationLibrary = SERIALIZATION_LIBRARY_JSONB;\n            this.jackson = false;\n        } else {\n            throw new IllegalArgumentException(\"Unexpected serializationLibrary value: \" + serializationLibrary);\n        }\n    }\n\n    /**\n     * Check if pom file and src directory already exist.\n     *\n     * @return outcome of test\n     */\n    @Override\n    protected boolean projectFilesExist() {\n        Path projectFolder = Paths.get(getOutputTestFolder());\n        Path pom = projectFolder.resolve(\"pom.xml\");\n        Path buildGradle = projectFolder.resolve(\"build.gradle\");\n        Path src = projectFolder.resolve(Paths.get(sourceFolder, invokerPackage.replace('.', File.separatorChar)));\n        return (pom.toFile().exists() || buildGradle.toFile().exists()) && src.toFile().exists();\n    }\n}\n","sourceCodeStart":467,"sourceCodeEnd":503,"githubUrl":"https://github.com/OpenAPITools/openapi-generator/blob/fcec517be3cf5b7964296bcba25fbc97541484e7/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonServerCodegen.java#L467-L503","documentation":"Thrown by JavaHelidonServerCodegen.setSerializationLibrary when serializationLibrary for the Helidon server generator is not 'jackson' or 'jsonb' (case-insensitive). Like the Helidon client (error 124), the server templates only wire Jackson and JSON-B, so gson and everything else is rejected during processOpts. If the property is absent the generator falls back to jackson with an INFO log before this switch runs.","triggerScenarios":"Running -g java-helidon-server with --additional-properties serializationLibrary=gson (or moshi/any unknown string). Passing a config file inherited from -g java. Calling setSerializationLibrary(\"gson\") in embedded usage.","commonSituations":"Uniform-serialization policies applied across a microservices estate include gson for Android-adjacent modules and break only the Helidon server jobs. Typos or wrong casing like 'JsonB' are accepted (case-insensitive) but 'json-b' with a hyphen is not.","solutions":["Set serializationLibrary to jackson or jsonb exactly: --additional-properties serializationLibrary=jsonb","Or drop the property and take the jackson default (logged as a fallback INFO message)","Validate shared configs against config-help -g java-helidon-server before rollout","For gson-based servers use a different generator (e.g. -g java with a gson-capable library)"],"exampleFix":"# before\nopenapi-generator-cli generate -g java-helidon-server -i api.yaml \\\n  --additional-properties serializationLibrary=gson\n\n# after\nopenapi-generator-cli generate -g java-helidon-server -i api.yaml \\\n  --additional-properties serializationLibrary=jsonb","handlingStrategy":"validation","validationCode":"String s = (String) opts.get(\"serializationLibrary\");\nif (s != null && !Set.of(\"jackson\", \"jsonb\").contains(s.toLowerCase(Locale.ROOT))) {\n    throw new IllegalArgumentException(\"java-helidon-server supports serializationLibrary=jackson|jsonb only, got: \" + s);\n}","typeGuard":null,"tryCatchPattern":"try {\n    codegen.processOpts();\n} catch (IllegalArgumentException e) {\n    // thrown from setSerializationLibrary before any output is written\n    throw new BuildFailure(\"Fix serializationLibrary for java-helidon-server: \" + e.getMessage(), e);\n}","preventionTips":["Scope serialization options to generators that demonstrably support them (verify via config-help)","Default to omitting serializationLibrary on Helidon generators (jackson fallback)","Automate a 'generate into temp dir' smoke test for every shared config in CI"],"tags":["java","helidon","openapi-generator","serialization","jackson","jsonb","configuration","option-validation"],"backgroundTag":"invalid-serialization-library","analyzedSha":"fcec517be3cf5b7964296bcba25fbc97541484e7","analyzedAt":"2026-08-22T11:13:11.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}