{"record":{"id":"60ca14de7d044b4d","repo":"OpenAPITools/openapi-generator","slug":"invalid-value-for-additional-property-declarative","errorCode":null,"errorMessage":"Invalid value for additional property 'declarativeInterfaceReactiveMode'. Supported values are {values}.","messagePattern":"Invalid value for additional property 'declarativeInterfaceReactiveMode'\\. Supported values are (.+?)\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java","lineNumber":739,"sourceCode":"            if (library.equals(SPRING_DECLARATIVE_HTTP_INTERFACE_LIBRARY)) {\n                this.setReactive(convertPropertyToBoolean(REACTIVE));\n                if (additionalProperties.containsKey(USE_FLOW_FOR_ARRAY_RETURN_TYPE)) {\n                    this.setUseFlowForArrayReturnType(convertPropertyToBoolean(USE_FLOW_FOR_ARRAY_RETURN_TYPE));\n                }\n                if (this.isUseFlowForArrayReturnType()) {\n                    {\n                        throw new IllegalArgumentException(\"Additional property '\" + USE_FLOW_FOR_ARRAY_RETURN_TYPE + \"' must be set to 'false' as it is not supported by Spring declarative HTTP interface\");\n                    }\n                }\n                if (additionalProperties.containsKey(DECLARATIVE_INTERFACE_REACTIVE_MODE)) {\n                    try {\n                        DeclarativeInterfaceReactiveMode optValue = DeclarativeInterfaceReactiveMode.valueOf(\n                                String.valueOf(additionalProperties.get(DECLARATIVE_INTERFACE_REACTIVE_MODE)));\n                        setDeclarativeInterfaceReactiveMode(optValue);\n                        writePropertyBack(optValue.getAdditionalPropertyName(), true);\n                        additionalProperties.remove(DECLARATIVE_INTERFACE_REACTIVE_MODE);\n                    } catch (IllegalArgumentException e) {\n                        throw new IllegalArgumentException(\n                                \"Invalid value for additional property '\" + DECLARATIVE_INTERFACE_REACTIVE_MODE + \"'. Supported values are \" + Arrays.toString(DeclarativeInterfaceReactiveMode.values()) + \".\"\n                        );\n                    }\n                }\n            }\n        }\n        if (SPRING_DECLARATIVE_HTTP_INTERFACE_LIBRARY.equals(library)) {\n            if (!isUseSpringBoot4()) {\n                this.setUseSpringBoot3(true);\n            }\n            this.setInterfaceOnly(true);\n            this.setUseFeignClient(false);\n            this.setSkipDefaultInterface(true);\n\n            writePropertyBack(USE_SPRING_BOOT3, useSpringBoot3);\n            writePropertyBack(INTERFACE_ONLY, interfaceOnly);\n            writePropertyBack(USE_FEIGN_CLIENT, useFeignClient);\n            writePropertyBack(SKIP_DEFAULT_INTERFACE, skipDefaultInterface);","sourceCodeStart":721,"sourceCodeEnd":757,"githubUrl":"https://github.com/OpenAPITools/openapi-generator/blob/fcec517be3cf5b7964296bcba25fbc97541484e7/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java#L721-L757","documentation":"For library=spring-http-interface with reactive=true, the `declarativeInterfaceReactiveMode` option selects how reactive operations are exposed. The value is parsed with DeclarativeInterfaceReactiveMode.valueOf() (KotlinSpringServerCodegen.java:733), which is case-sensitive and knows exactly two constants: `coroutines` (suspend functions) and `reactor` (Mono/Flux wrappers). Any other string — including uppercase or singular forms — rethrows as an IllegalArgumentException listing the supported values.","triggerScenarios":"Running with `--additional-properties library=spring-http-interface,reactive=true,declarativeInterfaceReactiveMode=COROUTINES` (uppercase), `=coroutine` (singular), `=mono`, or any typo. Only the exact lowercase strings `coroutines` and `reactor` pass.","commonSituations":"Assuming option values are case-insensitive (unlike documentationProvider/annotationLibrary, which are upper-cased before matching); using singular 'coroutine' because that is the common Kotlin terminology; option names/values drifting between generator versions or blog posts.","solutions":["Use exactly `declarativeInterfaceReactiveMode=coroutines` or `declarativeInterfaceReactiveMode=reactor` (lowercase, plural).","Omit the option if the default mode is acceptable.","Check the accepted values for your generator version with `openapi-generator-cli config-help -g kotlin-spring`."],"exampleFix":"# before\nopenapi-generator-cli generate -g kotlin-spring -i api.yaml \\\n  --additional-properties library=spring-http-interface,reactive=true,declarativeInterfaceReactiveMode=COROUTINES\n# after\nopenapi-generator-cli generate -g kotlin-spring -i api.yaml \\\n  --additional-properties library=spring-http-interface,reactive=true,declarativeInterfaceReactiveMode=coroutines","handlingStrategy":"validation","validationCode":"// valueOf is case-sensitive; validate before generating\nSet<String> modes = Set.of(\"coroutines\", \"reactor\");\nString mode = (String) opts.get(\"declarativeInterfaceReactiveMode\");\nif (mode != null && !modes.contains(mode)) {\n    throw new IllegalArgumentException(\n        \"declarativeInterfaceReactiveMode must be exactly one of \" + modes + \" (lowercase)\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    new DefaultGenerator().opts(clientOptInput).generate();\n} catch (IllegalArgumentException e) {\n    // message enumerates DeclarativeInterfaceReactiveMode.values(); show it to the user verbatim\n    throw new BuildException(\"Invalid kotlin-spring options: \" + e.getMessage(), e);\n}","preventionTips":["Note the asymmetry: this option is case-sensitive while documentationProvider/annotationLibrary are not.","Copy enum-valued options from `config-help` output, never from memory or blog posts.","Add a unit test asserting your build's full option set generates successfully."],"tags":["kotlin","spring","http-interface","reactive","coroutines","enum-value","openapi-generator","config-validation"],"backgroundTag":"invalid-option-value","analyzedSha":"fcec517be3cf5b7964296bcba25fbc97541484e7","analyzedAt":"2026-08-22T11:13:11.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}