Loopback远程方法响应消息doc

时间:2018-06-08 08:55:52

标签: node.js express swagger loopback

如何使用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'
  }
);
  

我无法将响应消息部分显示为

下面的图像

Response Messages

我可以在official loopback v3 documentation上看到一些属性,但我无法使其正常工作。

0 个答案:

没有答案