Javascript 如何在apidoc上记录动态对象属性

Javascript 如何在apidoc上记录动态对象属性,javascript,node.js,documentation,api-doc,Javascript,Node.js,Documentation,Api Doc,问题是,我想记录一个api响应,如下所示: { "box": { "1": "foo" "2": "bar" }, } /** * @api {get} /endpoint * @apiSuccess {Object} box Object description * @apiSuccess {String} box.?

问题是,我想记录一个api响应,如下所示:

{
    "box": {
        "1": "foo"
        "2": "bar"
    },
}
/**
 * @api {get} /endpoint
 * @apiSuccess {Object}  box       Object description
 * @apiSuccess {String}  box.?     Property description
 */
对象具有数字等动态特性

如何记录这些属性

例如,类似这样的内容:

{
    "box": {
        "1": "foo"
        "2": "bar"
    },
}
/**
 * @api {get} /endpoint
 * @apiSuccess {Object}  box       Object description
 * @apiSuccess {String}  box.?     Property description
 */

我使用Node.js只是为了以防万一。

我会考虑一下动态属性的共同点,并对此进行描述。如果它们除了是“盒子”的属性之外没有任何共同之处,我只想提一提

/**
 * @api {get} /endpoint
 * @apiSuccess {Object}  box       Object that includes dynamic properties, that may be numbers.
 */