Skip to content

Instantly share code, notes, and snippets.

@akira-kuriyama
Last active September 13, 2016 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akira-kuriyama/a2a121b4bc9af2adefd44422a946927f to your computer and use it in GitHub Desktop.
Save akira-kuriyama/a2a121b4bc9af2adefd44422a946927f to your computer and use it in GitHub Desktop.

FORMAT: 1A

Group ユーザAPI

ユーザ [/users/{id}]

ユーザの詳細 [GET]

処理概要

  • ユーザを取得する
  • Parameters

    • id: 1 (number, required) - ユーザID
  • Response 200

    • Body

          {
            "name" : "John",
            "age" : 20,
            "admin" : true
          }
      
    • Schema

          {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "age": {
                "type": "number"
              },
              "admin": {
                "type": "boolean"
              }
          }
      

ユーザの削除 [DELETE]

処理概要

  • ユーザを削除する
  • Paramaters

    • id: 1 (number, required) - ユーザID
  • Response 200

ユーザ Collection [/users/]

ユーザ登録 [POST]

処理概要

  • ユーザを登録する
  • Request (application/json)

    • Attributes

      • name: John (string, required) 名前
      • age: 20 (number, required) 年齢
      • admin: true (boolean, required) 管理者かどうか
  • Response 201 (application/json)

    • Headers

          Location: /users/1
      
    • Body

          {
            "name": "John",
            "age": 18,
            "admin": true
          }
      
    • Schema

          {
            "type" : "object",
            "properties" : {
                "id": {
                      "type" : "number"
                }
                "name": {
                      "type": "string"
                },
                "age": {
                      "type": "number"
                },
                "admin": {
                      "type": "boolean"
                }
            }
          }
      

ユーザ一覧 [GET]

  • Response 200 (application/json)

    • Attributes (array[User])

Data Structures

User (object)

  • id: 1 (number, required) ユーザID
  • name: John (string, required) 名前
  • age: 20 (number, required) 年齢
  • admin: true (boolean, required) 管理者かどうか
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment