{"record":{"id":"5a25acbcc21d421f","repo":"OpenAPITools/openapi-generator","slug":"currently-reactive-option-doesn-t-supported-by-sp-5a25ac","errorCode":null,"errorMessage":"Currently, reactive option doesn't supported by Spring Cloud","messagePattern":"Currently, reactive option doesn't supported by Spring Cloud","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java","lineNumber":569,"sourceCode":"        // does not support auto-generated markdown doc at the moment\n        // TODO: add doc templates\n        modelDocTemplateFiles.remove(\"model_doc.mustache\");\n        apiDocTemplateFiles.remove(\"api_doc.mustache\");\n\n        convertPropertyToStringAndWriteBack(TITLE, this::setTitle);\n        convertPropertyToStringAndWriteBack(CONFIG_PACKAGE, this::setConfigPackage);\n        convertPropertyToStringAndWriteBack(BASE_PACKAGE, this::setBasePackage);\n        convertPropertyToBooleanAndWriteBack(VIRTUAL_SERVICE, this::setVirtualService);\n        convertPropertyToBooleanAndWriteBack(INTERFACE_ONLY, this::setInterfaceOnly);\n        convertPropertyToBooleanAndWriteBack(USE_FEIGN_CLIENT_URL, this::setUseFeignClientUrl);\n        convertPropertyToBooleanAndWriteBack(USE_FEIGN_CLIENT_CONTEXT_ID, this::setUseFeignClientContextId);\n        convertPropertyToBooleanAndWriteBack(DELEGATE_PATTERN, this::setDelegatePattern);\n        convertPropertyToBooleanAndWriteBack(SINGLE_CONTENT_TYPES, this::setSingleContentTypes);\n        convertPropertyToBooleanAndWriteBack(SKIP_DEFAULT_INTERFACE, this::setSkipDefaultInterface);\n        convertPropertyToBooleanAndWriteBack(ASYNC, this::setAsync);\n        if (additionalProperties.containsKey(REACTIVE)) {\n            if (SPRING_CLOUD_LIBRARY.equals(library)) {\n                throw new IllegalArgumentException(\"Currently, reactive option doesn't supported by Spring Cloud\");\n            }\n            convertPropertyToBooleanAndWriteBack(REACTIVE, this::setReactive);\n            convertPropertyToBooleanAndWriteBack(SSE, this::setSse);\n        }\n        if (additionalProperties.containsKey(INCLUDE_HTTP_REQUEST_CONTEXT)) {\n            convertPropertyToBooleanAndWriteBack(INCLUDE_HTTP_REQUEST_CONTEXT, this::setIncludeHttpRequestContext);\n        }\n        //set default value for includeHttpRequestContext based on reactive/blocking\n        if (includeHttpRequestContext == null) {\n            if (this.reactive) {\n                //default to true for reactive\n                this.setIncludeHttpRequestContext(this.isDefaultIncludeHttpRequestContextForReactive());\n                LOGGER.info(\"Defaulting {} to '{}' for reactive\", INCLUDE_HTTP_REQUEST_CONTEXT, this.isDefaultIncludeHttpRequestContextForReactive());\n            } else {\n                //default to false for blocking\n                this.setIncludeHttpRequestContext(this.isDefaultIncludeHttpRequestContextForBlocking());\n                LOGGER.info(\"Defaulting {} to '{}' for blocking\", INCLUDE_HTTP_REQUEST_CONTEXT, this.isDefaultIncludeHttpRequestContextForBlocking());\n            }","sourceCodeStart":551,"sourceCodeEnd":587,"githubUrl":"https://github.com/OpenAPITools/openapi-generator/blob/fcec517be3cf5b7964296bcba25fbc97541484e7/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java#L551-L587","documentation":"In the spring generator, the reactive option (reactive=true, which enables WebFlux/Reactor return types) is explicitly incompatible with the spring-cloud library (spring-cloud-openfeign based). processOpts() throws IllegalArgumentException as soon as both are set, because the spring-cloud templates have no reactive variants.","triggerScenarios":"openapi-generator-cli generate -i api.yaml -g spring -l spring-cloud -c reactive=true; or a Maven/Gradle plugin config with <library>spring-cloud</library> and <reactive>true</reactive>. Also hit when reactive=true is set globally (e.g. in a shared config file) while one job selects -l spring-cloud.","commonSituations":"Organizations with a base config setting reactive=true for all spring services, then adding a Feign/spring-cloud client; upgrading pipelines where reactive was enabled for WebFlux services and later reused unintentionally.","solutions":["Remove reactive=true (or set reactive=false) for spring-cloud generation","Or switch the library to spring-boot to keep reactive/WebFlux output","Split shared configs so reactive is opt-in per library instead of global","If you need reactive Feign, generate with spring-cloud without reactive and adapt manually"],"exampleFix":"# before\nopenapi-generator-cli generate -i api.yaml -g spring -l spring-cloud -c reactive=true\n# after (option A: drop reactive)\nopenapi-generator-cli generate -i api.yaml -g spring -l spring-cloud\n# after (option B: keep reactive, switch library)\nopenapi-generator-cli generate -i api.yaml -g spring -l spring-boot -c reactive=true","handlingStrategy":"validation","validationCode":"# bash: enforce the option-compatibility matrix up front\nif [[ \"${LIBRARY:-spring-boot}\" == spring-cloud && \"${REACTIVE:-false}\" == true ]]; then\n  echo 'reactive=true is not supported with -l spring-cloud'; exit 1\nfi","typeGuard":null,"tryCatchPattern":"try {\n    SpringCodegen codegen = new SpringCodegen();\n    codegen.setLibrary(\"spring-boot\");   // not spring-cloud when reactive\n    codegen.setReactive(true);\n    new DefaultGenerator().opts(new ClientOptInput().opts(codegen)).generate();\n} catch (IllegalArgumentException e) {\n    // 'Currently, reactive option doesn't supported by Spring Cloud' - drop reactive or switch library\n}","preventionTips":["Keep reactive opt-in per job instead of a global default in shared configs","Document which spring libraries are reactive-capable (spring-boot) vs Feign-based (spring-cloud)","Encode the library x reactive matrix in your generation wrapper so invalid combos fail before the generator runs"],"tags":["java","spring","codegen","configuration","webflux","feign","openapi-generator"],"backgroundTag":"incompatible-generator-options","analyzedSha":"fcec517be3cf5b7964296bcba25fbc97541484e7","analyzedAt":"2026-08-22T11:13:11.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}