Skip to content

Commit ca60f58

Browse files
thiswasdumbCopilot
andcommitted
Trying to fix by setting as expected
Co-authored-by: Copilot <copilot@github.com>
1 parent 820dfc3 commit ca60f58

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

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

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,26 @@ public void processOpts() {
430430
documentationProvider = DocumentationProvider.NONE;
431431
annotationLibrary = AnnotationLibrary.NONE;
432432
useJakartaEe = true;
433+
if (!additionalProperties.containsKey(USE_BEANVALIDATION)) {
434+
useBeanValidation = false;
435+
} else {
436+
Object beanValidationValue = additionalProperties.get(USE_BEANVALIDATION);
437+
if (beanValidationValue instanceof Boolean) {
438+
useBeanValidation = (Boolean) beanValidationValue;
439+
} else if (beanValidationValue instanceof String) {
440+
useBeanValidation = Boolean.parseBoolean((String) beanValidationValue);
441+
}
442+
}
443+
if (!additionalProperties.containsKey(PERFORM_BEANVALIDATION)) {
444+
performBeanValidation = false;
445+
} else {
446+
Object performBeanValidationValue = additionalProperties.get(PERFORM_BEANVALIDATION);
447+
if (performBeanValidationValue instanceof Boolean) {
448+
performBeanValidation = (Boolean) performBeanValidationValue;
449+
} else if (performBeanValidationValue instanceof String) {
450+
performBeanValidation = Boolean.parseBoolean((String) performBeanValidationValue);
451+
}
452+
}
433453

434454
additionalProperties.put(USE_JAKARTA_EE, useJakartaEe);
435455
additionalProperties.put(USE_BEANVALIDATION, useBeanValidation);

0 commit comments

Comments
 (0)