autorest
autorest copied to clipboard
AutoRest generates duplicate constructors for model with no properties
Given this Swagger:
"DataChangeDetectionPolicy": {
"discriminator": "@odata.type",
"properties": {
"@odata.type": {
"type": "string"
}
},
"required": [
"@odata.type"
]
},
"SqlIntegratedChangeTrackingPolicy": {
"allOf": [
{
"$ref": "#/definitions/DataChangeDetectionPolicy"
}
]
},
AutoRest generates two default constructors in C# for both DataChangeDetectionPolicy and SqlIntegratedChangeTrackingPolicy, which results in an error when compiling the generated code.
AutoRest should omit the second constructor when the model has no properties.
I'm going to try to fix this.