Nestjs+ Swagger:如何将自定义选项添加到@apiproperty
是否可以将自定义选项添加到@ApiProperty装饰器?
import { ApiProperty } from '@nestjs/swagger';
class Animal {
@ApiProperty({
type: String,
description: 'animal name',
'x-description': 'some information' // how to add a cutom option 'x-description' ?
})
name: string;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不确定我是否完全了解,但是如果您在谈论 Openapi的扩展 。看看这一点: https://github.com/nestjs/nestjs/swagger/swagger/swagger/ssues/195 < /a>
I'm not sure i fully understand, but If you are talking about openapi's extensions. Take a look at this: https://github.com/nestjs/swagger/issues/195
从
Solution from https://github.com/nestjs/swagger/issues/195#issuecomment-526215840