I tried to generate a API document by apidoc
If my response is a array like
[
   {"id" : 1, "name" : "John"},
   {"id" : 2, "name" : "Mary"}
]
How could I set in @apiSuccess?
I had try Object[] but did not know how to set the field name. Thanks.
Lets say in the above example the id and name are of a user-profile, and you have an array of user-profile objects, then the @apiSuccess will look like:
/**
 * @api {get} /users
 * @apiSuccess {Object[]} profiles       List of user profiles.
 * @apiSuccess {Number}   profiles.Id    Users id.
 * @apiSuccess {String}   profiles.Name  Users Name.
 */
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With