Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <html>
  <head>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/3.19.5/swagger-ui.css" >
    <style>
      .topbar {
        display: none;
      }
    </style>
  </head>

  <body>
    <div id="swagger-ui"></div>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/3.19.5/swagger-ui-bundle.js"> </script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/3.19.5/swagger-ui-standalone-preset.js"> </script>
    <script src="./openapi.js"> </script>
    <script>
      window.onload = function() {
        const ui = SwaggerUIBundle({
          spec: spec,
          dom_id: '#swagger-ui',
          deepLinking: true,
          presets: [
            SwaggerUIBundle.presets.apis,
            SwaggerUIStandalonePreset
          ],
          plugins: [
            SwaggerUIBundle.plugins.DownloadUrl
          ],
          layout: "StandaloneLayout"
        })
     
        window.ui = ui
      }
  </script>
  </body>
</html>
              
            
!

CSS

              
                
              
            
!

JS

              
                var spec = {
  "swagger": "2.0",
  "info": {
    "version": "0.1.0",
    "title": "コンタクトレンズ着脱管理API"
  },
  "host": "xxx.execute-api.ap-northeast-1.amazonaws.com",
  "basePath": "/v1",
  "schemes": [
    "https"
  ],
  "paths": {
    "/devices": {
      "get": {
        "summary": "デバイスの一覧を取得する",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "成功",
            "schema": {
              "$ref": "#/definitions/GetDevicesResponse"
            }
          },
          "401": {
            "description": "認証エラー"
          },
          "500": {
            "description": "サーバーエラー"
          }
        }
      },
      "post": {
        "summary": "デバイスを登録する",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/PostDeviceRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功"
          },
          "401": {
            "description": "認証エラー"
          },
          "500": {
            "description": "サーバーエラー"
          }
        }
      }
    },
    "/devices/{deviceId}/wearing/current": {
      "get": {
        "summary": "現在のコンタクトレンズ着用状態を取得する",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "deviceId",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "schema": {
              "$ref": "#/definitions/GetDeviceWearingCurrentResponse"
            }
          },
          "401": {
            "description": "認証エラー"
          },
          "500": {
            "description": "サーバーエラー"
          }
        }
      }
    },
    "/devices/{deviceId}/wearing/stats": {
      "get": {
        "summary": "コンタクトレンズ着用統計データを取得する",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "deviceId",
            "required": true,
            "type": "string"
          },
          {
            "in": "query",
            "name": "startDate",
            "required": true,
            "description": "日付範囲開始日 (JST)\nex. 2021-01-01\n",
            "type": "string"
          },
          {
            "in": "query",
            "name": "endDate",
            "required": true,
            "description": "日付範囲終了日 (JST)\nex. 2021-01-07\n",
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "schema": {
              "$ref": "#/definitions/GetDeviceWearingStatsResponse"
            }
          },
          "401": {
            "description": "認証エラー"
          },
          "500": {
            "description": "サーバーエラー"
          }
        }
      }
    },
    "/settings/registration-token": {
      "put": {
        "summary": "FCMの登録トークンを登録する",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/PutSettingsRegistrationTokenRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功"
          },
          "401": {
            "description": "認証エラー"
          },
          "500": {
            "description": "サーバーエラー"
          }
        }
      }
    }
  },
  "definitions": {
    "GetDevicesResponse": {
      "type": "object",
      "required": [
        "devices"
      ],
      "properties": {
        "devices": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "deviceId"
            ],
            "properties": {
              "deviceId": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "PostDeviceRequest": {
      "type": "object",
      "required": [
        "deviceId"
      ],
      "properties": {
        "deviceId": {
          "type": "string"
        }
      }
    },
    "GetDeviceWearingCurrentResponse": {
      "type": "object",
      "description": "現在のコンタクトレンズ着用状態",
      "required": [
        "nowWearing"
      ],
      "properties": {
        "nowWearing": {
          "description": "着用中フラグ\n着用中であれば true となる\n",
          "type": "boolean",
          "example": true
        },
        "startTimestamp": {
          "description": "着用開始時間 (Optional)",
          "type": "number",
          "example": 1626764818
        },
        "endTimestamp": {
          "description": "着用終了時間 (Optional)",
          "type": "number",
          "example": 1626764819
        }
      }
    },
    "GetDeviceWearingStatsResponse": {
      "type": "object",
      "description": "コンタクトレンズ着用統計データ",
      "required": [
        "wearingDays",
        "averageWearingSeconds",
        "metircs"
      ],
      "properties": {
        "wearingDays": {
          "description": "着用日数",
          "type": "number",
          "example": 7
        },
        "averageWearingSeconds": {
          "description": "平均着用秒数",
          "type": "number",
          "example": 21600
        },
        "metrics": {
          "type": "array",
          "description": "並び順は着用日の昇順",
          "items": {
            "type": "object",
            "required": [
              "wearingDate",
              "wearingSeconds"
            ],
            "properties": {
              "wearingDate": {
                "description": "着用日 (JST)",
                "type": "string",
                "example": "2021-01-01"
              },
              "wearingSeconds": {
                "description": "着用秒数\n未着用の場合は0となる\n着用中のデータは返らない\n",
                "type": "number",
                "example": 16920
              }
            }
          }
        }
      }
    },
    "PutSettingsRegistrationTokenRequest": {
      "type": "object",
      "required": [
        "registrationToken"
      ],
      "properties": {
        "registrationToken": {
          "type": "string"
        }
      }
    }
  }
}
              
            
!
999px

Console