{"record":{"id":"6ece8c3697e277a8","repo":"OpenAPITools/openapi-generator","slug":"unexpected-serializationlibrary-value-serializat-6ece8c","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/JavaHelidonClientCodegen.java","lineNumber":466,"sourceCode":"            }\n        }\n\n        return objs;\n    }\n\n    public void setCaseInsensitiveResponseHeaders(final Boolean caseInsensitiveResponseHeaders) {\n        this.caseInsensitiveResponseHeaders = caseInsensitiveResponseHeaders;\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    @Override\n    public Map<String, Object> postProcessSupportingFileData(Map<String, Object> objs) {\n        generateYAMLSpecFile(objs);\n        return super.postProcessSupportingFileData(objs);\n    }\n\n    @Override\n    public String toApiVarName(String name) {\n        String apiVarName = super.toApiVarName(name);\n        if (reservedWords.contains(apiVarName)) {\n            apiVarName = escapeReservedWord(apiVarName);\n        }\n        return apiVarName;\n    }\n","sourceCodeStart":448,"sourceCodeEnd":484,"githubUrl":"https://github.com/OpenAPITools/openapi-generator/blob/fcec517be3cf5b7964296bcba25fbc97541484e7/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonClientCodegen.java#L448-L484","documentation":"Thrown by JavaHelidonClientCodegen.setSerializationLibrary when the java-helidon-client generator receives a serializationLibrary other than 'jackson' or 'jsonb'. Unlike the generic Java client (error 123), the Helidon client templates do not support gson, so the accepted set here is smaller and case-insensitive. The setter runs during processOpts via convertPropertyToStringAndWriteBack on CodegenConstants.SERIALIZATION_LIBRARY.","triggerScenarios":"Running -g java-helidon-client with --additional-properties serializationLibrary=gson (or moshi, or any non-jackson/jsonb string). Copying a config from -g java where gson was valid and passing it via --config. Programmatically calling setSerializationLibrary(\"gson\") on the Helidon client codegen.","commonSituations":"Teams standardizing generated clients on gson across a monorepo apply the same additionalProperties to the Helidon generator and hit the narrower support matrix. Also happens after switching a pipeline from -g java --library okhttp-gson to the dedicated Helidon generator while keeping the old serialization settings.","solutions":["Use jackson or jsonb: --additional-properties serializationLibrary=jackson (or jsonb)","Remove the serializationLibrary property entirely to accept the generator default","If gson is a hard requirement, generate with -g java --library okhttp-gson instead of java-helidon-client","Run `openapi-generator-cli config-help -g java-helidon-client` to confirm the options this generator accepts before sharing configs"],"exampleFix":"# before\nopenapi-generator-cli generate -g java-helidon-client -i api.yaml \\\n  --additional-properties serializationLibrary=gson\n\n# after\nopenapi-generator-cli generate -g java-helidon-client -i api.yaml \\\n  --additional-properties serializationLibrary=jsonb","handlingStrategy":"validation","validationCode":"// java-helidon-client accepts only jackson or jsonb\nString s = (String) opts.get(\"serializationLibrary\");\nif (s != null && !Set.of(\"jackson\", \"jsonb\").contains(s.toLowerCase(Locale.ROOT))) {\n    throw new IllegalArgumentException(\"java-helidon-client supports serializationLibrary=jackson|jsonb only, got: \" + s);\n}","typeGuard":null,"tryCatchPattern":"try {\n    new DefaultGenerator().opts(input).generate();\n} catch (IllegalArgumentException e) {\n    // 'Unexpected serializationLibrary value' — no partial output is produced; fix the option and rerun\n    throw new BuildFailure(\"helidon-client serializationLibrary rejected: \" + e.getMessage(), e);\n}","preventionTips":["Scope serialization options per generator, not globally across a monorepo","After switching -g targets, diff the old config against the new generator's config-help output","Treat gson as Java-client-only knowledge; do not assume portability to helidon generators"],"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"}