I require object list of a class in ApiModelProperty
See original GitHub issueI’m submitting a…
[ ] Regression
[ ] Bug report
[ x ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
Right now `@ApiResponseModelProperty({ … }) I require object list of a class.
Expected behavior
@ApiResponseModelProperty I want to be able to get a list of my class
Minimal reproduction of the problem with instructions
i have 2 class: Articulo and UnidadMedida
export class UnidadMedida extends BaseModel { @prop() descripcion: string; @prop() abrev: string; }
Class: Articulo
export class Articulo extends BaseModel { @prop() nombre: string; @prop({ ref: UnidadMedida, required: true }) unidadmedida_id: Ref<UnidadMedida>; }
I have created a record class to show in the swagger, but I want to list the _id of my class unit measure
export class RegisterArticuloVm { @ApiModelProperty() nombre: string; @ApiModelProperty() unidadmedida_id: UnidadMedida (is my class UnidadMedida); }
What is the motivation / use case for changing the behavior?
I’m new using swagger, i don’t understand as obtain list of my class with ApiResponse Model Property
PD: I Love NESTJS ❤️
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (1 by maintainers)
Top GitHub Comments
Hey @Russ3ll-Franz, you need to setup UnidadMedia with ApiModelProperties as well to display in the model. Something like below might help, the @IsString(), @Type() & @ValidateNested() decorators is for validation so might not be needed for your use case, but validation is always handy to have.
`
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.