summaryrefslogtreecommitdiff
path: root/src/api
diff options
context:
space:
mode:
authorTosuke <tasukeprg@gmail.com>2017-01-04 15:04:54 +0900
committerTosuke <tasukeprg@gmail.com>2017-01-04 15:04:54 +0900
commit4dd5a443e5c6dc9248dd1e771063aa2071f521f5 (patch)
tree97ec62b15600c916fbe6bbc162c9e14b9a709c78 /src/api
parentAdd host and schemes to swaggerJSON (diff)
downloadsharkey-4dd5a443e5c6dc9248dd1e771063aa2071f521f5.tar.gz
sharkey-4dd5a443e5c6dc9248dd1e771063aa2071f521f5.tar.bz2
sharkey-4dd5a443e5c6dc9248dd1e771063aa2071f521f5.zip
[WIP][Swagger]Add swagger definition
- /auth/session/userkey - User entity
Diffstat (limited to 'src/api')
-rw-r--r--src/api/endpoints/auth/session/generate.js1
-rw-r--r--src/api/endpoints/auth/session/userkey.js36
-rw-r--r--src/api/endpoints/users.js76
3 files changed, 113 insertions, 0 deletions
diff --git a/src/api/endpoints/auth/session/generate.js b/src/api/endpoints/auth/session/generate.js
index 07ff8a8195..1390ae2909 100644
--- a/src/api/endpoints/auth/session/generate.js
+++ b/src/api/endpoints/auth/session/generate.js
@@ -15,6 +15,7 @@ import AuthSess from '../../../models/auth-session';
* parameters:
* -
* name: app_secret
+ * description: App Secret
* in: formData
* required: true
* type: string
diff --git a/src/api/endpoints/auth/session/userkey.js b/src/api/endpoints/auth/session/userkey.js
index 2626e4ce39..918caa8f39 100644
--- a/src/api/endpoints/auth/session/userkey.js
+++ b/src/api/endpoints/auth/session/userkey.js
@@ -9,6 +9,42 @@ import Userkey from '../../../models/userkey';
import serialize from '../../../serializers/user';
/**
+ * @swagger
+ * /auth/session/userkey:
+ * post:
+ * summary: Get a userkey
+ * parameters:
+ * -
+ * name: app_secret
+ * description: App Secret
+ * in: formData
+ * required: true
+ * type: string
+ * -
+ * name: token
+ * description: API Token
+ * in: formData
+ * required: true
+ * type: string
+ *
+ * responses:
+ * 200:
+ * description: OK
+ * schema:
+ * type: object
+ * properties:
+ * userkey:
+ * type: string
+ * description: User Key
+ * user:
+ * $ref: "#/definitions/User"
+ * 400:
+ * description: Failed
+ * schema:
+ * $ref: "#/definitions/Error"
+ */
+
+/**
* Generate a session
*
* @param {Object} params
diff --git a/src/api/endpoints/users.js b/src/api/endpoints/users.js
index cd40cdf4e1..bb47b4b64a 100644
--- a/src/api/endpoints/users.js
+++ b/src/api/endpoints/users.js
@@ -7,6 +7,82 @@ import User from '../models/user';
import serialize from '../serializers/user';
/**
+ * @swagger
+ * definitions:
+ * User:
+ * type: object
+ * required:
+ * - created_at
+ * - followers_count
+ * - following_count
+ * - id
+ * - liked_count
+ * - likes_count
+ * - name
+ * - posts_count
+ * - username
+ * properties:
+ * avatar_id:
+ * type: string
+ * description: アバターに設定しているドライブのファイルのID
+ * avatar_url:
+ * type: string
+ * description: アバターURL
+ * banner_id:
+ * type: string
+ * description: バナーに設定しているドライブのファイルのID
+ * banner_url:
+ * type: string
+ * description: バナーURL
+ * bio:
+ * type: string
+ * description: プロフィール
+ * birthday:
+ * type: string
+ * description: 誕生日
+ * created_at:
+ * type: string
+ * format: date
+ * description: アカウント作成日時
+ * drive_capacity:
+ * type: integer
+ * description: ドライブの最大容量
+ * followers_count:
+ * type: integer
+ * description: フォロワー数
+ * following_count:
+ * type: integer
+ * description: フォロー数
+ * id:
+ * type: string
+ * description: ユーザーID
+ * is_followed:
+ * type: boolean
+ * description: フォローされているか
+ * is_following:
+ * type: boolean
+ * description: フォローしているか
+ * liked_count:
+ * type: integer
+ * description: 投稿にいいねされた数
+ * likes_count:
+ * type: integer
+ * description: 投稿にいいねした数
+ * location:
+ * type: string
+ * description: 場所
+ * name:
+ * type: string
+ * description: ニックネーム
+ * posts_count:
+ * type: integer
+ * description: 投稿数
+ * username:
+ * type: string
+ * description: ユーザー名
+ */
+
+/**
* Lists all users
*
* @param {Object} params