我在环回 4 中完成了这个模型:
@property({
type: 'string',
id: true,
default: () => uuid(),
})
id: string;
@property({
type: 'string',
required: true,
})
name: string;
如您所见,id 是默认生成的。但是在环回/资源管理器中
出现 id。我想隐藏它,如果它是自动生成的,它可能会给想要使用这个 API 的开发人员带来困惑。任何人都知道如何将属性放入模型中,并将其隐藏在/explorer
?
谢谢。
只需从请求正文模式中排除 id
@requestBody({
content: {
'application/json': {
schema: getModelSchemaRef(Model, {exclude: ['id']}),
},
},
}
希望这有助于谢谢
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句