apiDoc: meta (#8167)

* apiDoc: meta

* Update modelsPaths.js

* Update error

* fix test

* Update GET-model_paths.test.js

* Fixed test
This commit is contained in:
MathWhiz
2017-01-13 15:06:46 -06:00
committed by Keith Holliday
parent fd7aedbff2
commit f888e80b01
3 changed files with 19 additions and 3 deletions

View File

@@ -11,9 +11,24 @@ let allModels = ['user', 'tag', 'challenge', 'group'].concat(tasksModels);
* @apiName GetUserModelPaths
* @apiGroup Meta
*
* @apiParam {String="user","group","challenge","tag","habit","daily","todo","reward"} model The name of the model
* @apiParam (Path) {String="user","group","challenge","tag","habit","daily","todo","reward"} model The name of the model
*
* @apiExample {curl} Tag
* curl https://habitica.com/api/v3/models/tag/paths
*
* @apiSuccess {Object} data A key-value object made of fieldPath: fieldType (like {'field.nested': Boolean})
*
* @apiSuccessExample {json} Tag
* {
* "success":true,
* "data": {
* "id":"String",
* "name":"String",
* "challenge":"String"
* }
* }
*
* @apiError (400) {badRequest} modelNotFound The model specified was not found
*/
api.getModelPaths = {
method: 'GET',