apiParam(示例)和对象

时间:2018-10-01 15:09:30

标签: api-doc

我不知道为什么这行不通。医生说:

/**
 * @api {get} /user/:id
 * @apiSuccess {Boolean} active        Specify if the account is active.
 * @apiSuccess {Object}  profile       User profile information.
 * @apiSuccess {Number}  profile.age   Users age.
 * @apiSuccess {String}  profile.image Avatar-Image.
 */

这是我的代码

 * @apiParam {Object}    file
 * @apiParam {String}    file.bucket
 * @apiParam {String}    file.key
 * @apiParam {String}    file.name
 *
 * @apiParamExample {json} Request:
 * {
 *          "file": {
 *              "bucket": "testmediabucket1",
 *              "key": "key2",
 *              "name": "klassefoto.jpg"
 *          }
 * }
 *
 * @apiSuccessExample
 *      true

PowerShell给我以下错误: @apiParamExample和@apiParam中的不匹配!参数'file.bucket'不存在,以及'file.key''file.name'

1 个答案:

答案 0 :(得分:0)

可能是这样的

  • @apiParam {Object} 文件
  • @apiParam {String} 文件[bucket]
  • @apiParam {String} 文件[key]
  • @apiParam {String} 文件[名称]