Skip to content

Commit 7559b58

Browse files
fail when an unsupported combination of parameters is used
1 parent 4ce631a commit 7559b58

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -382,14 +382,12 @@ public void processOpts() {
382382
if (useJackson3 && libRestClient && !useSpringBoot4) {
383383
throw new IllegalArgumentException("useJackson3 for the restclient library requires useSpringBoot4=true");
384384
} else if (useJackson3 && !libNative && !libRestClient) {
385-
LOGGER.warn("useJackson3 is only supported for 'native' and 'restclient' libraries. Disabling useJackson3.");
386-
useJackson3 = false;
387-
additionalProperties.put(USE_JACKSON_3, false);
385+
throw new IllegalArgumentException("useJackson3 is only supported for the 'native' and 'restclient' libraries. " +
386+
"Either set library=native or library=restclient (restclient also requires useSpringBoot4=true), or set useJackson3=false.");
388387
}
389388
if (useJackson3 && openApiNullable) {
390-
LOGGER.warn("openApiNullable is not supported with useJackson3=true (jackson-databind-nullable has no Jackson 3 release). Disabling openApiNullable.");
391-
openApiNullable = false;
392-
additionalProperties.put(OPENAPI_NULLABLE, false);
389+
throw new IllegalArgumentException("openApiNullable=true is not compatible with useJackson3=true " +
390+
"(jackson-databind-nullable has no Jackson 3 release). Please set openApiNullable=false explicitly.");
393391
}
394392

395393
if(this.useJackson3){

0 commit comments

Comments
 (0)