{"record":{"id":"a71539482cbd281b","repo":"OpenAPITools/openapi-generator","slug":"version-s-of-microprofile-rest-client-is-not-supp","errorCode":null,"errorMessage":"Version %s of MicroProfile Rest Client is not supported or incorrect. Supported versions are %s","messagePattern":"Version (.+?) of MicroProfile Rest Client is not supported or incorrect\\. Supported versions are (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java","lineNumber":480,"sourceCode":"        if (additionalProperties.containsKey(MICROPROFILE_FRAMEWORK)) {\n            if (!MICROPROFILE_KUMULUZEE.equals(microprofileFramework)) {\n                throw new RuntimeException(\"Invalid microprofileFramework '\" + microprofileFramework + \"'. Must be 'kumuluzee' or none.\");\n            }\n//            this.setMicroprofileFramework(additionalProperties.get(MICROPROFILE_FRAMEWORK).toString());\n        }\n        convertPropertyToStringAndWriteBack(MICROPROFILE_FRAMEWORK, this::setMicroprofileFramework);\n\n        convertPropertyToBooleanAndWriteBack(MICROPROFILE_GLOBAL_EXCEPTION_MAPPER, this::setMicroProfileGlobalExceptionMapper);\n        convertPropertyToBooleanAndWriteBack(MICROPROFILE_REGISTER_EXCEPTION_MAPPER, this::setMicroProfileRegisterExceptionMapper);\n\n        additionalProperties.put(MICROPROFILE_REGISTER_EXCEPTION_MAPPER, microProfileRegisterExceptionMapper);\n        additionalProperties.put(MICROPROFILE_GLOBAL_EXCEPTION_MAPPER, microProfileGlobalExceptionMapper);\n\n        convertPropertyToBooleanAndWriteBack(MICROPROFILE_MUTINY, this::setMicroprofileMutiny);\n\n        convertPropertyToStringAndWriteBack(MICROPROFILE_REST_CLIENT_VERSION, value -> microprofileRestClientVersion = value);\n        if (!mpRestClientVersions.containsKey(microprofileRestClientVersion)) {\n            throw new IllegalArgumentException(\n                    String.format(Locale.ROOT,\n                            \"Version %s of MicroProfile Rest Client is not supported or incorrect. Supported versions are %s\",\n                            microprofileRestClientVersion,\n                            String.join(\", \", mpRestClientVersions.keySet())\n                    )\n            );\n        }\n\n        if (!additionalProperties.containsKey(\"rootJavaEEPackage\")) {\n            String mpRestClientVersion = (String) additionalProperties.get(MICROPROFILE_REST_CLIENT_VERSION);\n            if (mpRestClientVersions.containsKey(mpRestClientVersion)) {\n                rootJavaEEPackage = mpRestClientVersions.get(mpRestClientVersion).rootPackage;\n            }\n            additionalProperties.put(\"rootJavaEEPackage\", rootJavaEEPackage);\n        }\n\n        if (additionalProperties.containsKey(CONFIG_KEY)) {\n            convertPropertyToStringAndWriteBack(CONFIG_KEY, this::setConfigKey);","sourceCodeStart":462,"sourceCodeEnd":498,"githubUrl":"https://github.com/OpenAPITools/openapi-generator/blob/fcec517be3cf5b7964296bcba25fbc97541484e7/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java#L462-L498","documentation":"Thrown by JavaClientCodegen.processOpts when microprofileRestClientVersion is not a key of the mpRestClientVersions map. The generator only ships pom templates for MicroProfile Rest Client '1.4.1', '2.0' (the default), and '3.0'; each key also decides the javax vs jakarta root package. The lookup happens right after convertPropertyToStringAndWriteBack, so the value must match one of those exact strings.","triggerScenarios":"Passing --additional-properties microprofileRestClientVersion=1.3 (or 1.0, 1.1, 1.2, 2.1, 3.1, '2', '2.0.0') with -g java --library microprofile. Also triggered by config files that carry a version string from an older/newer generator release whose key set differed, or by values with trailing whitespace or different casing.","commonSituations":"Developers target a MicroProfile implementation whose Rest Client TCK level is 1.2 or 2.1 and assume any released version is accepted. Others migrate configs between generator versions where the supported set changed (e.g. 1.4.1 replaced older 1.x keys), or paste '2.0.0-FINAL' style OSGi/semantic versions instead of the plain key.","solutions":["Use one of the exact supported keys: 1.4.1, 2.0, or 3.0 (e.g. --additional-properties microprofileRestClientVersion=1.4.1)","If you omitted the option and still see the error, a config file is injecting a stale value — remove or update the microprofileRestClientVersion key there","Pick 3.0 when you need the jakarta.* namespace; 1.4.1 and 2.0 generate javax.* code","Verify the value has no whitespace/quotes when passed through JSON config or CI environment variables"],"exampleFix":"# before\nopenapi-generator-cli generate -g java -i api.yaml \\\n  --library microprofile --additional-properties microprofileRestClientVersion=1.2\n\n# after\nopenapi-generator-cli generate -g java -i api.yaml \\\n  --library microprofile --additional-properties microprofileRestClientVersion=1.4.1","handlingStrategy":"validation","validationCode":"Set<String> supported = Set.of(\"1.4.1\", \"2.0\", \"3.0\");\nString v = String.valueOf(opts.getOrDefault(\"microprofileRestClientVersion\", \"2.0\"));\nif (!supported.contains(v)) {\n    throw new IllegalArgumentException(\"microprofileRestClientVersion must be one of \" + supported + \", got: \" + v);\n}","typeGuard":null,"tryCatchPattern":"try {\n    generator.generate();\n} catch (IllegalArgumentException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"MicroProfile Rest Client\")) {\n        // surface supported versions to the user and fail fast\n        throw new ConfigurationException(\"Unsupported microprofileRestClientVersion: \" + opts.get(\"microprofileRestClientVersion\") + \". Use 1.4.1, 2.0 or 3.0\", e);\n    }\n    throw e;\n}","preventionTips":["Pin the MicroProfile Rest Client version explicitly in configs instead of relying on defaults that shift between generator releases","Add a schema check for enum-valued options in your config-as-code pipeline","Never hand-assemble version strings; reuse values echoed from config-help"],"tags":["java","openapi-generator","microprofile","version-management","configuration","option-validation"],"backgroundTag":"unsupported-version-specified","analyzedSha":"fcec517be3cf5b7964296bcba25fbc97541484e7","analyzedAt":"2026-08-22T11:13:11.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}