--- openapi: 3.0.3 info: title: api version: 1.0.0 servers: [] paths: "/api/login": post: summary: login tags: - Api::Auth requestBody: content: application/x-www-form-urlencoded: schema: type: object properties: email: type: string password: type: string example: email: michael@example.com password: password responses: '200': description: has status 200 content: application/json: schema: type: object properties: user: type: object properties: email: type: string id: type: integer name: type: string gravator_url: type: string token: type: string example: user: email: michael@example.com id: 7015 name: Michael Example gravator_url: https://secure.gravatar.com/avatar/03ea78c0884c9ac0f73e6af7b9649e90 token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo3MDE1fQ.hHxQ2aXHB3wXm3wYkgCeACkgk5BAV2MqtOznDSOkuIY "/api/auto_login": get: summary: auto_login tags: - Api::Auth responses: '200': description: has status ok content: application/json: schema: type: object properties: user: type: object properties: id: type: integer name: type: string email: type: string created_at: type: string activated: type: boolean activated_at: type: string gravator_url: type: string microposts: type: array items: nullable: true example: user: id: 7022 name: user_4 email: test4@example.com created_at: '2021-12-02T14:59:12.343Z' activated: true activated_at: '2021-12-02T14:59:12.338Z' gravator_url: https://secure.gravatar.com/avatar/94cd715c8961b8c40644657a3757297e microposts: [] '401': description: has status 401 content: application/json: schema: type: object properties: message: type: string example: message: Please log in "/api/auto_relationships": get: summary: auto_relationships tags: - Api::Auth responses: '200': description: has status 200 content: application/json: schema: type: object properties: relationships: type: object properties: following: type: array items: nullable: true followers: type: array items: nullable: true following_index: type: array items: nullable: true followers_index: type: array items: nullable: true example: relationships: following: [] followers: [] following_index: [] followers_index: [] '401': description: has status 401 content: application/json: schema: type: object properties: message: type: string example: message: Please log in "/api/auto_feed": get: summary: auto_feed tags: - Api::Auth parameters: - name: Offset in: query schema: type: integer example: 0 - name: Limit in: query schema: type: integer example: 10 responses: '200': description: has status 200 content: application/json: schema: type: object properties: microposts: type: array items: nullable: true example: microposts: [] "/api/likes": post: summary: create tags: - Api::Like parameters: - name: micropost_id in: query schema: type: integer example: 1486 - name: micropost_id in: query schema: type: integer example: 1487 - name: micropost_id in: query schema: type: integer example: 1488 - name: micropost_id in: query schema: type: integer example: 1489 - name: micropost_id in: query schema: type: integer example: 1491 - name: micropost_id in: query schema: type: integer example: 1492 responses: '200': description: has status 200 content: application/json: schema: type: object properties: message: type: string micropost: type: object properties: id: type: integer content: type: string user_id: type: integer created_at: type: string updated_at: type: string example: message: like the micropost successfully micropost: id: 1486 content: sample content no_1 user_id: 7035 created_at: '2021-12-02T14:59:13.174Z' updated_at: '2021-12-02T14:59:13.174Z' '400': description: the same user can not create the same like content: application/json: schema: type: object properties: micropost: type: object properties: id: type: integer content: type: string user_id: type: integer created_at: type: string updated_at: type: string current_user: type: object properties: id: type: integer name: type: string email: type: string created_at: type: string updated_at: type: string password_digest: type: string admin: type: boolean activation_digest: type: string activated: type: boolean activated_at: type: string reset_digest: nullable: true reset_sent_at: nullable: true message: type: string example: micropost: id: 1492 content: sample content no_7 user_id: 7046 created_at: '2021-12-02T14:59:13.623Z' updated_at: '2021-12-02T14:59:13.623Z' current_user: id: 7047 name: user_23 email: test23@example.com created_at: '2021-12-02T14:59:13.637Z' updated_at: '2021-12-02T14:59:13.637Z' password_digest: "$2a$04$E2Pj5nXUSe8cN2UO9ARQu.9ghE97HExIIW0CZecovEfBhlXkWr8.2" admin: false activation_digest: "$2a$04$nvqjmdD.uX5zKSR3ZwEnKe2It1/IiCL6FzX4yezqe.OdG0ea3EndK" activated: true activated_at: '2021-12-02T14:59:13.631Z' reset_digest: reset_sent_at: message: Fail to like micropost '401': description: has status 401 content: application/json: schema: type: object properties: message: type: string example: message: Please log in delete: summary: destroy tags: - Api::Like parameters: - name: micropost_id in: query schema: type: integer example: 1494 - name: micropost_id in: query schema: type: integer example: 1495 - name: micropost_id in: query schema: type: integer example: 1497 - name: micropost_id in: query schema: type: integer example: 1498 - name: micropost_id in: query schema: type: integer example: 1499 - name: micropost_id in: query schema: type: integer example: 1500 - name: micropost_id in: query schema: type: integer example: 1501 - name: micropost_id in: query schema: type: integer example: 1502 - name: micropost_id in: query schema: type: integer example: 1503 - name: micropost_id in: query schema: type: integer example: 1504 responses: '202': description: has status 204 content: application/json: schema: type: object properties: message: type: string example: message: Like is cancelled successfully '400': description: has status 400 content: application/json: schema: type: object properties: message: type: string example: message: Like is not founded '401': description: has status 401 content: application/json: schema: type: object properties: message: type: string example: message: Please log in "/api/microposts": post: summary: create tags: - Api::Micropost requestBody: content: application/x-www-form-urlencoded: schema: type: object properties: micropost: type: object properties: content: type: string example: micropost: content: Content Sample responses: '200': description: has status 200 content: application/json: schema: type: object properties: micropost: type: object properties: id: type: integer content: type: string user_id: type: integer created_at: type: string updated_at: type: string message: type: string example: micropost: id: 1505 content: Content Sample user_id: 7075 created_at: '2021-12-02T14:59:14.768Z' updated_at: '2021-12-02T14:59:14.768Z' message: Micropost created "/api/microposts/{id}": put: summary: update tags: - Api::Micropost parameters: - name: id in: path required: true schema: type: integer example: 1510 - name: id in: path required: true schema: type: integer example: 1511 - name: id in: path required: true schema: type: integer example: 1512 requestBody: content: application/x-www-form-urlencoded: schema: type: object properties: micropost: type: object properties: content: type: string example: micropost: content: Micropost updated responses: '200': description: has status 200 content: application/json: schema: type: object properties: micropost: type: object properties: content: type: string id: type: integer user_id: type: integer created_at: type: string updated_at: type: string message: type: string example: micropost: content: Micropost updated id: 1510 user_id: 7083 created_at: '2021-12-02T14:59:15.061Z' updated_at: '2021-12-02T14:59:15.092Z' message: Micropost updated Successfully "/api/users": get: summary: index tags: - Api::User responses: '200': description: status ok content: application/json: schema: type: array items: type: object properties: id: type: integer name: type: string email: type: string gravator_url: type: string example: - id: 7088 name: user_53 email: test53@example.com gravator_url: https://secure.gravatar.com/avatar/dd3ef9cf131360b9425faa4778faba54 - id: 7089 name: user_54 email: test54@example.com gravator_url: https://secure.gravatar.com/avatar/3ee17889077c069d786b8fdde2333685 - id: 7090 name: user_55 email: test55@example.com gravator_url: https://secure.gravatar.com/avatar/72a832f6f5621e3796a631d2c2f08dba - id: 7091 name: user_56 email: test56@example.com gravator_url: https://secure.gravatar.com/avatar/ad95bea7badb976a5bdc32163171d28f - id: 7092 name: user_57 email: test57@example.com gravator_url: https://secure.gravatar.com/avatar/c000303002c32b8c94435d92ae89c03d - id: 7093 name: user_58 email: test58@example.com gravator_url: https://secure.gravatar.com/avatar/379546989ab9649a87e0811c6177a498 - id: 7094 name: user_59 email: test59@example.com gravator_url: https://secure.gravatar.com/avatar/1996dc6d2ce163dcf9ef3083b357bb0d - id: 7095 name: user_60 email: test60@example.com gravator_url: https://secure.gravatar.com/avatar/84625290b43b74f71294861ba14d0ef1 - id: 7096 name: user_61 email: test61@example.com gravator_url: https://secure.gravatar.com/avatar/daa2ddd27d3a670b4adc81405018a4cf - id: 7097 name: user_62 email: test62@example.com gravator_url: https://secure.gravatar.com/avatar/b6cdc6a104057617d7a96b9ff428eb9c post: summary: create tags: - Api::User requestBody: content: application/x-www-form-urlencoded: schema: type: object properties: user: type: object properties: name: type: string email: type: string password: type: string password_confirmation: type: string example: user: name: test name email: example@railstutorial.com password: password password_confirmation: password responses: '201': description: has status 201 content: application/json: schema: type: object properties: user: type: object properties: id: type: integer name: type: string email: type: string created_at: type: string updated_at: type: string password_digest: type: string admin: type: boolean activation_digest: type: string activated: type: boolean activated_at: nullable: true reset_digest: nullable: true reset_sent_at: nullable: true token: type: string gravator_url: type: string example: user: id: 7241 name: test name email: example@railstutorial.com created_at: '2021-12-02T14:59:19.088Z' updated_at: '2021-12-02T14:59:19.088Z' password_digest: "$2a$04$lsbxAxlgcpK4aZ8P5zhj7u4F60qEog.Y87Yuk5p2Z4S9fhMHgtgAm" admin: false activation_digest: "$2a$04$sNf.TNLkEy6IRXK/XQ8zTuKWea.z7K9EmrhICvGzG8rZE0dJftra2" activated: false activated_at: reset_digest: reset_sent_at: token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo3MjQxfQ.DmGUEoU36cX2TZv6X2dmsoGb14gSXOqdkA-mzD91aow gravator_url: https://secure.gravatar.com/avatar/f1a6a90ea0fceff55be9e5abf44f9a1e '400': description: has status 401 content: application/json: schema: type: object properties: errors: type: object properties: email: type: array items: type: string password: type: array items: type: string password_confirmation: type: array items: type: string example: errors: email: - is invalid password: - is too short (minimum is 6 characters) password_confirmation: - doesn't match Password "/api/users/{id}": get: summary: show tags: - Api::User parameters: - name: id in: path required: true schema: type: integer example: 7118 - name: id in: path required: true schema: type: integer example: 7119 responses: '200': description: status ok content: application/json: schema: type: object properties: id: type: integer name: type: string email: type: string created_at: type: string gravator_url: type: string following_count: type: integer followers_count: type: integer microposts: type: array items: nullable: true example: id: 7118 name: user_83 email: test83@example.com created_at: '2021-12-02T14:59:15.727Z' gravator_url: https://secure.gravatar.com/avatar/03ab9d5d66b2bcc370f10f5c2872e72e following_count: 0 followers_count: 0 microposts: [] put: summary: update tags: - Api::User parameters: - name: id in: path required: true schema: type: integer example: 7244 - name: id in: path required: true schema: type: integer example: 7245 - name: id in: path required: true schema: type: integer example: 7246 - name: id in: path required: true schema: type: integer example: 7248 - name: id in: path required: true schema: type: integer example: 7250 - name: id in: path required: true schema: type: integer example: 7251 - name: id in: path required: true schema: type: integer example: 7252 - name: id in: path required: true schema: type: integer example: 7254 requestBody: content: application/x-www-form-urlencoded: schema: type: object properties: user: type: object properties: name: type: string email: type: string password: type: string password_confirmation: type: string example: user: name: edit name email: michael@example.com password: password password_confirmation: password responses: '200': description: has status 200 content: application/json: schema: type: object properties: id: type: integer name: type: string email: type: string gravator_url: type: string example: id: 7244 name: edit name email: michael@example.com gravator_url: https://secure.gravatar.com/avatar/03ea78c0884c9ac0f73e6af7b9649e90 '403': description: response has status 403 content: application/json: schema: type: object properties: message: type: string example: message: You are not correct user "/api/users/{id}/following": get: summary: following tags: - Api::User parameters: - name: id in: path required: true schema: type: integer example: 7120 - name: id in: path required: true schema: type: integer example: 7131 - name: id in: path required: true schema: type: integer example: 7142 - name: id in: path required: true schema: type: integer example: 7153 responses: '200': description: status ok content: application/json: schema: type: object properties: user: type: object properties: id: type: integer name: type: string gravator_url: type: string following: type: array items: type: object properties: id: type: integer name: type: string gravator_url: type: string example: user: id: 7120 name: user_85 gravator_url: https://secure.gravatar.com/avatar/641d10179e91116f0b33ea157b8f2c00 following: - id: 7121 name: user_86 gravator_url: https://secure.gravatar.com/avatar/65c82f1a734848d286dc99f2133d4911 - id: 7122 name: user_87 gravator_url: https://secure.gravatar.com/avatar/e4bd70ef7dc987875fda9ced72f7b3ea - id: 7123 name: user_88 gravator_url: https://secure.gravatar.com/avatar/5acd991f6f1f0fd392206f5c944d7f8e - id: 7124 name: user_89 gravator_url: https://secure.gravatar.com/avatar/a01979da0ca00fc88c9988058d4c8070 - id: 7125 name: user_90 gravator_url: https://secure.gravatar.com/avatar/f23a9f71a77302ecf3b352c4473dc039 - id: 7126 name: user_91 gravator_url: https://secure.gravatar.com/avatar/3c754d402911d15244df36a4521c5f11 - id: 7127 name: user_92 gravator_url: https://secure.gravatar.com/avatar/fc201b6adf64ec657cac8eb4b1e963f1 - id: 7128 name: user_93 gravator_url: https://secure.gravatar.com/avatar/423ec743142a559c185c70f4c7423c53 - id: 7129 name: user_94 gravator_url: https://secure.gravatar.com/avatar/2def48d0964352f05bc8962b12c32bba - id: 7130 name: user_95 gravator_url: https://secure.gravatar.com/avatar/7b29ba5514a847f450f8ac83930d1473 "/api/users/{id}/followers": get: summary: followers tags: - Api::User parameters: - name: id in: path required: true schema: type: integer example: 7164 - name: id in: path required: true schema: type: integer example: 7175 - name: id in: path required: true schema: type: integer example: 7186 - name: id in: path required: true schema: type: integer example: 7197 responses: '200': description: status ok content: application/json: schema: type: object properties: user: type: object properties: id: type: integer name: type: string gravator_url: type: string followers: type: array items: type: object properties: id: type: integer name: type: string gravator_url: type: string example: user: id: 7164 name: user_129 gravator_url: https://secure.gravatar.com/avatar/e3f6c0512fbedbc30d26d73297a13706 followers: - id: 7165 name: user_130 gravator_url: https://secure.gravatar.com/avatar/f9292220e8da0a43fefd72d5ec781a3f - id: 7166 name: user_131 gravator_url: https://secure.gravatar.com/avatar/58065a89def18f1fc3262c4b75b90f01 - id: 7167 name: user_132 gravator_url: https://secure.gravatar.com/avatar/b6f1bc5185649556356f0f41478f540b - id: 7168 name: user_133 gravator_url: https://secure.gravatar.com/avatar/2a6c10905af57a171132b5c90557d509 - id: 7169 name: user_134 gravator_url: https://secure.gravatar.com/avatar/151c540fd7f946150558265cb97d1bb5 - id: 7170 name: user_135 gravator_url: https://secure.gravatar.com/avatar/2fdba78550430a942ca035e2e722bd2b - id: 7171 name: user_136 gravator_url: https://secure.gravatar.com/avatar/4eeb844d3389cf41a30b5960b6813a23 - id: 7172 name: user_137 gravator_url: https://secure.gravatar.com/avatar/ddc130457eed39446ba04adce7f4cf75 - id: 7173 name: user_138 gravator_url: https://secure.gravatar.com/avatar/ba363f14d105affe9fae73082a27b078 - id: 7174 name: user_139 gravator_url: https://secure.gravatar.com/avatar/848aad5179e769fb0416557acb2487cf "/api/users/{id}/likes": get: summary: likes tags: - Api::User parameters: - name: id in: path required: true schema: type: integer example: 7208 - name: id in: path required: true schema: type: integer example: 7219 - name: id in: path required: true schema: type: integer example: 7230 responses: '200': description: status ok content: application/json: schema: type: object properties: microposts: type: array items: type: object properties: id: type: integer content: type: string user_id: type: integer created_at: type: string gravator_url: type: string name: type: string example: microposts: - id: 1522 content: sample content no_32 user_id: 7218 created_at: '2021-12-02T14:59:18.232Z' gravator_url: https://secure.gravatar.com/avatar/5ba135cc42249f07c0bf8cd6aa60afa1 name: user_183 - id: 1521 content: sample content no_31 user_id: 7217 created_at: '2021-12-02T14:59:18.216Z' gravator_url: https://secure.gravatar.com/avatar/82c47eaa47d45b968f6ae0f9378e28f5 name: user_182 - id: 1520 content: sample content no_30 user_id: 7216 created_at: '2021-12-02T14:59:18.198Z' gravator_url: https://secure.gravatar.com/avatar/db3e5c71650380274b912efe7d6caf46 name: user_181 - id: 1519 content: sample content no_29 user_id: 7215 created_at: '2021-12-02T14:59:18.181Z' gravator_url: https://secure.gravatar.com/avatar/64bb9ba12454d0441d91ce1dc4729886 name: user_180 - id: 1518 content: sample content no_28 user_id: 7214 created_at: '2021-12-02T14:59:18.165Z' gravator_url: https://secure.gravatar.com/avatar/a58005757dcf41c366f241e3faab5cbf name: user_179 - id: 1517 content: sample content no_27 user_id: 7213 created_at: '2021-12-02T14:59:18.147Z' gravator_url: https://secure.gravatar.com/avatar/270c77cb16e6a737bf7730fc83f63a33 name: user_178 - id: 1516 content: sample content no_26 user_id: 7212 created_at: '2021-12-02T14:59:18.129Z' gravator_url: https://secure.gravatar.com/avatar/c6221b4872e895ba0fa2ca526ce4fc22 name: user_177 - id: 1515 content: sample content no_25 user_id: 7211 created_at: '2021-12-02T14:59:18.111Z' gravator_url: https://secure.gravatar.com/avatar/21a380eac31db20762e4b05834189dd9 name: user_176 - id: 1514 content: sample content no_24 user_id: 7210 created_at: '2021-12-02T14:59:18.093Z' gravator_url: https://secure.gravatar.com/avatar/d1f51ed0a81edcc6ee42fc530ad2d992 name: user_175 - id: 1513 content: sample content no_23 user_id: 7209 created_at: '2021-12-02T14:59:18.075Z' gravator_url: https://secure.gravatar.com/avatar/9dbd60e375ef7e0f4623f7230d1558c8 name: user_174