Skip to content

Commit 347938e

Browse files
committed
Fix the logic gap where useOptional=true without patchOnly=true appears to do nothing
1 parent 8a8ff1e commit 347938e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ public ModelsMap postProcessModels(ModelsMap objs) {
628628
shouldUseOptional = patchRequestSchemas.contains(model.classname);
629629
} else {
630630
Boolean schemaUseOptional = (Boolean) model.vendorExtensions.get("x-use-optional");
631-
shouldUseOptional = schemaUseOptional != null && schemaUseOptional;
631+
shouldUseOptional = schemaUseOptional == null || schemaUseOptional;
632632
}
633633

634634
if (shouldUseOptional) {

0 commit comments

Comments
 (0)