Unchase.Swashbuckle.AspNetCore.Extensions
Unchase.Swashbuckle.AspNetCore.Extensions copied to clipboard
Multiple Enum Labels with the Same Value Results in Unusable Output
I have an enum with multiple labels pointing to the same value.
public enum SomeFields
{
Field1 = 1,
AnotherNameForField1 = Field1,
Field2 = 2,
}
Unfortunately, that results in a non-matchable list of values and names:
"SomeFields": {
"enum": [
1,
2
],
"type": "integer",
"format": "int32",
"x-enumNames": [
"Field1",
"AnotherNameForField1",
"Field2"
]
},
Can that be fixed by eighter: duplicate the enum values (enum), or remove the duplicate labels from the labels list (x-enumNames)?