Skip to content

Commit b443ebb

Browse files
Copilotalexaka1
andcommitted
fix: don't propagate isString from enum models to properties
Setting property.isString on enum ref properties caused duplicate WriteString statements in anyOf models (e.g., IconsSizeParameter). String enum properties are already handled through the isEnum template path, not the isString path, so propagating isString is both unnecessary and harmful. Co-authored-by: alexaka1 <22166651+alexaka1@users.noreply.github.com>
1 parent cdb6d61 commit b443ebb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,9 @@ protected void patchProperty(Map<String, CodegenModel> enumRefs, CodegenModel mo
848848
property.isFloat = refModel.isFloat;
849849
property.isDouble = refModel.isDouble;
850850
property.isDecimal = refModel.isDecimal;
851-
property.isString = refModel.isString;
851+
// Note: do NOT propagate isString here. String enum properties
852+
// are handled through the isEnum template path, not the isString path.
853+
// Setting isString would cause duplicate write statements in anyOf models.
852854
}
853855

854856
this.patchPropertyIsInherited(model, property);

0 commit comments

Comments
 (0)