using extends in DTO classes appears to be broken between 1.2.2 and 1.3.0.
minimal example:
class foo {
@ApiModelPropertyOptional()
public prop?: string;
};
class bar extends foo {
@ApiModelPropertyOptional()
public otherProp?: string;
}
@Controller("leads")
@ApiProduces("application/json; charset=utf-8")
export class LeadsController {
constructor() {}
@Get()
@ApiResponse({ status: 200, type: bar })
public find(): bar {
return {
prop: "asdf",
otherProp: "asdf"
}
}
}
using this controller, I get an error in swagger-ui: Uncaught ReferenceError: foo is not defined.
The generated swagger actually looks correct:
"paths": {
"/leads": {
"get": {
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/bar"
}
}
},
"produces": [
"application/json"
],
"consumes": [
"application/json"
]
}
}
},
"definitions": {
"bar": {
"type": "object",
"properties": {
"prop": {
"type": "string"
},
"otherProp": {
"type": "string"
}
}
}
}
but when swagger ui tries to consume it, it looks like this:

None of the recent changes look immediately obvious as the problem - any ideas?
Got the exact same problem with v2.0.0
馃憤
Fixed in 2.0.1
@kamilmysliwiec I get the same problem with the version @nestjs/swagger 4.2.3. I get error when I extend dtos
@dancespiele please, create a separate issue and share a minimal repository that reproduces your issue.
Most helpful comment
Got the exact same problem with v2.0.0