I'm submitting a ...
I confirm that I
When declaring a class based model, only instance (non-static) properties are part of the objects of said type:
export class ClassBasedModelType {
InstanceField: string;
static StaticField: string;
}
Therefore, static properties are not part of the response, thus neither the swagger doc
"ClassBasedModelType": {
"properties": {
"InstanceField": {
"type": "string"
}
},
"required": [
"InstanceField"
],
"type": "object",
"additionalProperties": true
}
Currently static properties are included in the swagger doc nonetheless:
"ClassBasedModelType": {
"properties": {
"InstanceField": {
"type": "string"
},
"StaticField": {
"type": "string"
}
},
"required": [
"InstanceField",
"StaticField"
],
"type": "object",
"additionalProperties": true
}
Version of the library: 3.0.4
Version of NodeJS: 13.11.0
Static properties in TypeScript are part of the class rather than the instances. Logically, a JSON response based on a type containing static properties does not include static properties of the type, because they are not part of the instance itself (which is used for the response).
Nonetheless currently tsoa includes static properties in the swagger doc exactly same as instance properties.
Current workaround is to @ignore all static properties (ignore works normally despite the props being static).
@WoH I can try to help with this one also 馃榿
Most helpful comment
@WoH I can try to help with this one also 馃榿