I'm using swagger codegen 3.0.21 for generating a C# api client.
The generators creates for all referenced classes additional classes in /Model beginning with AllOf[Classname].
Why does Swagger CodeGen generate these classes? What is their porpuse? They also have multiple errors with my sepcification.
Relevant changed part of the generated json:
"components": {
"schemas": {
"MyClass": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"propertyTwo": {
"type": "integer",
"format": "int64"
},
"propertyThree": {
"allOf": [
{
"$ref": "#/components/schemas/MySecondClass"
}
],
"nullable": true
},
"propertyFour": {
"allOf": [
{
"$ref": "#/components/schemas/MyThirdClass"
}
],
"nullable": true
},
"propertyFive": {
"type": "array",
"items": {
"$ref": "#/components/schemas/MyFourthClass"
},
"nullable": true
},
"propertySix": {
"type": "boolean"
}
},
"additionalProperties": false
},
}
}
The constructor for MyClass is generated as following:
public MyClass(long? id = default(long?), long? propertyTwo = default(long?), propertyThree = default(), propertyFour = default(), List<MyThirdClass> propertyFive = default(List<MyFourthClass>), bool? propertySix = default(bool?))
As you can see the datatypes for propertyThree and propertyFour are just empty spaces.