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 @@ -8,6 +8,42 @@ import AuthSess from '../../../models/auth-session'; 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 * 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 @@ -6,6 +6,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 * diff --git a/swagger.js b/swagger.js index a7046e3bd5..9cb5e85095 100644 --- a/swagger.js +++ b/swagger.js @@ -6,7 +6,9 @@ const yaml = require('js-yaml'); const apiRoot = './src/api/endpoints'; const files = [ - 'auth/session/generate.js' + 'users.js', + 'auth/session/generate.js', + 'auth/session/userkey.js', ]; const errorDefinition = {