如何使用remoteMethod
定义而不是swagger.yaml文件定义要在资源管理器中显示在文档中的响应消息信息。
例如:
UserModel.remoteMethod(
'login',
{
description: 'Login a enterprise user with username and password.',
accepts: [
{arg: 'credentials', type: 'PostCredentials', required: true, http: {source: 'body'}},
{
arg: 'include', type: ['string'], http: {source: 'query'},
description: 'Related objects to include in the response...'
},
],
returns: {
arg: 'accessToken', type: 'object', root: true,
description:
'The response body contains properties of the {{AccessToken}} created on login..',
},
http: {verb: 'post'},
notes: 'Long notes to show'
}
);
我无法将响应消息部分显示为
下面的图像
我可以在official loopback v3 documentation上看到一些属性,但我无法使其正常工作。