The @nestjs/swagger doc describes here that defining an extra model should be done this way:
@ApiExtraModels(ExtraModel)
export class CreateCatDto {}
But what is ExtraModel here ? The doc is not very clear about this.
The @nestjs/swagger doc describes here that defining an extra model should be done this way:
@ApiExtraModels(ExtraModel)
export class CreateCatDto {}
But what is ExtraModel here ? The doc is not very clear about this.
Worked for me, when I've set @ApiExtraModels(MyModelClass) on the top of controller.
Thanks for this topic and also to this comment in GitHub issue.
I don't want to list all models in extraModels array in SwaggerModule.createDocument, so this is a great solution for me.
I ran into the same uncertainity. After googling https://github.com/nestjs/swagger/pull/355/files I understood the documentation:
import { ExtraModel } from '<filename>' (<--- so this is lacking in the docs BTW)I guess you had the same mind-twister as me that the ApiExtraModels-decorator acts on the model ...
Cheers, Stephan