Skip to content

Instantly share code, notes, and snippets.

@zerefdev
Created January 26, 2021 18:39

Revisions

  1. zerefdev created this gist Jan 26, 2021.
    33 changes: 33 additions & 0 deletions apidoc.code-snippets
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@
    {
    "apidoc boilerplate": {
    "scope": "javascript, typescript",
    "prefix": "apidoc",
    "body": [
    "/**",
    " * @api {$1} /$2/$3 $4",
    " * @apiVersion 1.0.0",
    " * @apiName $1-$3",
    " * @apiGroup $2",
    " * @apiPermission $5",
    " *",
    " * @apiParam (Body) {String} $0",
    " * ",
    " * @apiSuccessExample Success:",
    " * HTTP/1.1 200 OK",
    " * {",
    " * \"message\": \"message\",",
    " * }",
    " * ",
    " * @apiErrorExample Error - Validation:",
    " * HTTP/1.1 400 Bad Request",
    " * ",
    " * {",
    " * \"error\": \"message\"",
    " * }",
    " * ",
    " * @apiSampleRequest off",
    " */"
    ],
    "description": "generates apidoc boilerplate"
    }
    }