From a5ff6fb285eeb3b6ecce59b846a1f610a89a11c2 Mon Sep 17 00:00:00 2001
From: Tosuke <tasukeprg@gmail.com>
Date: Fri, 6 Jan 2017 18:33:03 +0900
Subject: [PATCH] [Swagger]Add /app/create

---
 src/api/endpoints/app/create.js | 53 +++++++++++++++++++++++++++++++++
 swagger.js                      |  1 +
 2 files changed, 54 insertions(+)

diff --git a/src/api/endpoints/app/create.js b/src/api/endpoints/app/create.js
index d83062c8e9..9ce98b197a 100644
--- a/src/api/endpoints/app/create.js
+++ b/src/api/endpoints/app/create.js
@@ -7,6 +7,59 @@ import rndstr from 'rndstr';
 import App from '../../models/app';
 import serialize from '../../serializers/app';
 
+/**
+ * @swagger
+ * /app/create:
+ *   post:
+ *     summary: Create an application
+ *     parameters:
+ *       - $ref: "#/parameters/AccessToken"
+ *       -
+ *         name: name_id
+ *         description: Application unique name
+ *         in: formData
+ *         required: true
+ *         type: string
+ *       -
+ *         name: name
+ *         description: Application name
+ *         in: formData
+ *         required: true
+ *         type: string
+ *       -
+ *         name: description
+ *         description: Application description
+ *         in: formData
+ *         required: true
+ *         type: string
+ *       -
+ *         name: permission
+ *         description: Permissions that application has
+ *         in: formData
+ *         required: true
+ *         type: array
+ *         items:
+ *           type: string
+ *           collectionFormat: csv
+ *       -
+ *         name: callback_url
+ *         description: URL called back after authentication
+ *         in: formData
+ *         required: false
+ *         type: string
+ *       
+ *     responses:
+ *       200:
+ *         description: Created application's information
+ *         schema:
+ *           $ref: "#/definitions/Application"
+ *       
+ *       default:
+ *         description: Failed
+ *         schema:
+ *           $ref: "#/definitions/Error"
+ */
+
 /**
  * Create an app
  *
diff --git a/swagger.js b/swagger.js
index 9391e80c5a..4a23ebacb3 100644
--- a/swagger.js
+++ b/swagger.js
@@ -9,6 +9,7 @@ const files = [
   'users.js',
   //app
   'app/show.js',
+  'app/create.js',
   'app/name_id/available.js',
   //auth
   'auth/accept.js',