{
  "openapi": "3.0.3",
  "info": {
    "title": "OpenAPI Documentation",
    "version": "1.0.0",
    "description": "My beautiful API",
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
    }
  },
  "servers": [
    {
      "url": "http://localhost:3000"
    }
  ],
  "paths": {
    "/additional_properties": {
      "get": {
        "summary": "index",
        "tags": [
          "AdditionalProperty"
        ],
        "responses": {
          "200": {
            "description": "returns some content",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "required_key": {
                      "type": "string"
                    },
                    "variadic_key": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "integer"
                      }
                    }
                  },
                  "required": [
                    "required_key",
                    "variadic_key"
                  ]
                },
                "example": {
                  "required_key": "value",
                  "variadic_key": {
                    "gold": 1,
                    "silver": 2,
                    "bronze": 3
                  }
                }
              }
            }
          }
        }
      }
    },
    "/images": {
      "get": {
        "summary": "index",
        "tags": [
          "Image"
        ],
        "responses": {
          "200": {
            "description": "can return an object with an attribute of empty array",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "tags": {
                        "type": "array",
                        "items": {}
                      }
                    },
                    "required": [
                      "name",
                      "tags"
                    ]
                  }
                },
                "example": [
                  {
                    "name": "file.png",
                    "tags": []
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/images/upload": {
      "post": {
        "summary": "upload",
        "tags": [
          "Image"
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "image": {
                    "type": "string",
                    "format": "binary"
                  }
                },
                "required": [
                  "image"
                ]
              },
              "example": {
                "image": "test.png"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "returns a image payload with upload",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          }
        }
      }
    },
    "/images/upload_multiple": {
      "post": {
        "summary": "upload_multiple",
        "tags": [
          "Image"
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "images": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary"
                    }
                  }
                },
                "required": [
                  "images"
                ]
              },
              "example": {
                "images": [
                  "test.png",
                  "test.png"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "returns a image payload with upload multiple",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          }
        }
      }
    },
    "/images/upload_multiple_nested": {
      "post": {
        "summary": "upload_multiple_nested",
        "tags": [
          "Image"
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "images": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "image": {
                          "type": "string",
                          "format": "binary"
                        }
                      },
                      "required": [
                        "image"
                      ]
                    }
                  }
                },
                "required": [
                  "images"
                ]
              },
              "example": {
                "images": [
                  {
                    "image": "test.png"
                  },
                  {
                    "image": "test.png"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "returns a image payload with upload multiple nested",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          }
        }
      }
    },
    "/images/upload_nested": {
      "post": {
        "summary": "upload_nested",
        "tags": [
          "Image"
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "nested_image": {
                    "type": "object",
                    "properties": {
                      "image": {
                        "type": "string",
                        "format": "binary"
                      },
                      "caption": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "image",
                      "caption"
                    ]
                  }
                },
                "required": [
                  "nested_image"
                ]
              },
              "example": {
                "nested_image": {
                  "image": "test.png",
                  "caption": "Some caption"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "returns a image payload with upload nested",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          }
        }
      }
    },
    "/images/{id}": {
      "get": {
        "summary": "show",
        "tags": [
          "Image"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 1
          }
        ],
        "responses": {
          "200": {
            "description": "returns a image payload",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          }
        }
      }
    },
    "/my_engine/eng_route": {
      "get": {
        "summary": "GET /my_engine/eng_route",
        "tags": [],
        "responses": {
          "200": {
            "description": "returns some content from the engine",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "AN ENGINE TEST"
              }
            }
          }
        }
      }
    },
    "/my_engine/test": {
      "get": {
        "summary": "GET /my_engine/test",
        "tags": [],
        "responses": {
          "200": {
            "description": "returns the block content",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "ANOTHER TEST"
              }
            }
          }
        }
      }
    },
    "/rack/bar": {
      "get": {
        "summary": "GET /rack/bar",
        "responses": {
          "200": {
            "description": "returns some content bar",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "A RACK BAR"
              }
            }
          }
        }
      }
    },
    "/rack/foo": {
      "get": {
        "summary": "GET /rack/foo",
        "responses": {
          "200": {
            "description": "returns some content foo",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "A RACK FOO"
              }
            }
          }
        }
      }
    },
    "/secret_items": {
      "get": {
        "summary": "index",
        "tags": [
          "SecretItem"
        ],
        "security": [
          {
            "SecretApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "authorizes with secret key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "items"
                  ]
                },
                "example": {
                  "items": [
                    "secrets"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "authorizes with secret key",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                },
                "example": ""
              }
            }
          }
        }
      }
    },
    "/sites/{name}": {
      "get": {
        "summary": "show",
        "tags": [
          "Site"
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "no-such"
          }
        ],
        "responses": {
          "200": {
            "description": "finds a site",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "name"
                  ]
                },
                "example": {
                  "name": "abc123"
                }
              }
            }
          },
          "404": {
            "description": "raises not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                },
                "example": {
                  "message": "not found"
                }
              }
            }
          }
        }
      }
    },
    "/tables": {
      "get": {
        "summary": "index",
        "tags": [
          "Table"
        ],
        "parameters": [
          {
            "name": "X-Authorization-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "token"
          },
          {
            "name": "filter[name]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "name"
              ]
            },
            "example": {
              "name": "Example Table"
            }
          },
          {
            "name": "filter[price]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "object",
              "properties": {
                "price": {
                  "type": "string"
                }
              },
              "required": [
                "price"
              ]
            },
            "example": {
              "price": "0"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "example": 1
          },
          {
            "name": "per",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "example": 10
          }
        ],
        "responses": {
          "200": {
            "description": "with different deep query parameters",
            "headers": {
              "X-Cursor": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer"
                      },
                      "name": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "database": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      },
                      "null_sample": {
                        "nullable": true
                      },
                      "storage_size": {
                        "type": "number",
                        "format": "float"
                      },
                      "created_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "updated_at": {
                        "type": "string",
                        "format": "date-time"
                      }
                    },
                    "required": [
                      "id",
                      "name",
                      "description",
                      "database",
                      "null_sample",
                      "storage_size",
                      "created_at",
                      "updated_at"
                    ]
                  }
                },
                "example": [
                  {
                    "id": 1,
                    "name": "access",
                    "description": "logs",
                    "database": {
                      "id": 2,
                      "name": "production"
                    },
                    "null_sample": null,
                    "storage_size": 12.3,
                    "created_at": "2020-07-17T00:00:00+00:00",
                    "updated_at": "2020-07-17T00:00:00+00:00"
                  }
                ]
              }
            }
          },
          "401": {
            "description": "does not return tables if unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                },
                "example": {
                  "message": "Unauthorized"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "create",
        "tags": [
          "Table"
        ],
        "responses": {
          "201": {
            "description": "returns a table",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "database": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ]
                    },
                    "null_sample": {
                      "nullable": true
                    },
                    "storage_size": {
                      "type": "number",
                      "format": "float"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "description",
                    "database",
                    "null_sample",
                    "storage_size",
                    "created_at",
                    "updated_at"
                  ]
                },
                "example": {
                  "id": 1,
                  "name": "access",
                  "description": "logs",
                  "database": {
                    "id": 2,
                    "name": "production"
                  },
                  "null_sample": null,
                  "storage_size": 12.3,
                  "created_at": "2020-07-17T00:00:00+00:00",
                  "updated_at": "2020-07-17T00:00:00+00:00"
                }
              }
            }
          },
          "422": {
            "description": "fails to create a table (2)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": "invalid name parameter"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "database_id": {
                    "type": "integer"
                  }
                },
                "required": [
                  "name",
                  "description",
                  "database_id"
                ]
              },
              "example": {
                "name": "k0kubun",
                "description": "description",
                "database_id": 2
              }
            }
          }
        }
      }
    },
    "/tables/{id}": {
      "delete": {
        "summary": "destroy",
        "tags": [
          "Table"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 1
          }
        ],
        "responses": {
          "200": {
            "description": "returns a table",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "database": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ]
                    },
                    "null_sample": {
                      "nullable": true
                    },
                    "storage_size": {
                      "type": "number",
                      "format": "float"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "description",
                    "database",
                    "null_sample",
                    "storage_size",
                    "created_at",
                    "updated_at"
                  ]
                },
                "example": {
                  "id": 1,
                  "name": "access",
                  "description": "logs",
                  "database": {
                    "id": 2,
                    "name": "production"
                  },
                  "null_sample": null,
                  "storage_size": 12.3,
                  "created_at": "2020-07-17T00:00:00+00:00",
                  "updated_at": "2020-07-17T00:00:00+00:00"
                }
              }
            }
          },
          "202": {
            "description": "returns no content if specified"
          }
        }
      },
      "get": {
        "summary": "show",
        "tags": [
          "Table"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 2
          }
        ],
        "responses": {
          "200": {
            "description": "returns a table",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "database": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ]
                    },
                    "null_sample": {
                      "nullable": true
                    },
                    "storage_size": {
                      "type": "number",
                      "format": "float"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "description",
                    "database",
                    "null_sample",
                    "storage_size",
                    "created_at",
                    "updated_at"
                  ]
                },
                "example": {
                  "id": 1,
                  "name": "access",
                  "description": "logs",
                  "database": {
                    "id": 2,
                    "name": "production"
                  },
                  "null_sample": null,
                  "storage_size": 12.3,
                  "created_at": "2020-07-17T00:00:00+00:00",
                  "updated_at": "2020-07-17T00:00:00+00:00"
                }
              }
            }
          },
          "401": {
            "description": "does not return a table if unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                },
                "example": {
                  "message": "Unauthorized"
                }
              }
            }
          },
          "404": {
            "description": "does not return a table if not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                },
                "example": {
                  "message": "not found"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "update",
        "tags": [
          "Table"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 1
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ]
              },
              "example": {
                "name": "test"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "returns a table",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "database": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ]
                    },
                    "null_sample": {
                      "nullable": true
                    },
                    "storage_size": {
                      "type": "number",
                      "format": "float"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "description",
                    "database",
                    "null_sample",
                    "storage_size",
                    "created_at",
                    "updated_at"
                  ]
                },
                "example": {
                  "id": 1,
                  "name": "access",
                  "description": "logs",
                  "database": {
                    "id": 2,
                    "name": "production"
                  },
                  "null_sample": null,
                  "storage_size": 12.3,
                  "created_at": "2020-07-17T00:00:00+00:00",
                  "updated_at": "2020-07-17T00:00:00+00:00"
                }
              }
            }
          }
        }
      }
    },
    "/test_block": {
      "get": {
        "summary": "GET /test_block",
        "tags": [],
        "responses": {
          "200": {
            "description": "returns the block content",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "A TEST"
              }
            }
          }
        },
        "deprecated": true
      }
    }
  },
  "components": {
    "securitySchemes": {
      "SecretApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "Secret-Key"
      }
    }
  },
  "custom_field": "custom_value"
}