0

The thing is that I want to documentate an api response that looks like this:

{
    "box": {
        "1": "foo"
        "2": "bar"
    },
}

The object has dynamic properties such as numbers.

How can I document these properties?

For example, something like this:

/**
 * @api {get} /endpoint
 * @apiSuccess {Object}  box       Object description
 * @apiSuccess {String}  box.?     Property description
 */

I am using Node.js just in case.

andresf
  • 198
  • 1
  • 10

1 Answers1

0

I would think about what the dynamic properties have in common and describe that. If they have nothing in common besides being properties of "box", I would just mention that.

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