{
  "swagger": "2.0",
  "info": {
    "description": "This is an auto-generated API Docs.",
    "title": "API",
    "termsOfService": "http://swagger.io/terms/",
    "contact": {
      "name": "API Support",
      "email": "your@mail.com"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "version": "1.0"
  },
  "basePath": "/api",
  "paths": {
    "/v1/book": {
      "put": {
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "description": "Update book.",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Book"
        ],
        "summary": "update book",
        "parameters": [
          {
            "description": "Book ID",
            "name": "id",
            "in": "body",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Title",
            "name": "title",
            "in": "body",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Author",
            "name": "author",
            "in": "body",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Book status",
            "name": "book_status",
            "in": "body",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Book attributes",
            "name": "book_attrs",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/models.BookAttrs"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "ok",
            "schema": {
              "type": "string"
            }
          }
        }
      },
      "post": {
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "description": "Create a new book.",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Book"
        ],
        "summary": "create a new book",
        "parameters": [
          {
            "description": "Title",
            "name": "title",
            "in": "body",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Author",
            "name": "author",
            "in": "body",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Book attributes",
            "name": "book_attrs",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/models.BookAttrs"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/models.Book"
            }
          }
        }
      },
      "delete": {
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "description": "Delete book by given ID.",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Book"
        ],
        "summary": "delete book by given ID",
        "parameters": [
          {
            "description": "Book ID",
            "name": "id",
            "in": "body",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "ok",
            "schema": {
              "type": "string"
            }
          }
        }
      }
    },
    "/v1/book/{id}": {
      "get": {
        "description": "Get book by given ID.",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Book"
        ],
        "summary": "get book by given ID",
        "parameters": [
          {
            "type": "string",
            "description": "Book ID",
            "name": "id",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/models.Book"
            }
          }
        }
      }
    },
    "/v1/books": {
      "get": {
        "description": "Get all exists books.",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Books"
        ],
        "summary": "get all exists books",
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/models.Book"
              }
            }
          }
        }
      }
    },
    "/v1/token/new": {
      "get": {
        "description": "Create a new access token.",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Token"
        ],
        "summary": "create a new access token",
        "responses": {
          "200": {
            "description": "ok",
            "schema": {
              "type": "string"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "models.Book": {
      "type": "object",
      "required": [
        "author",
        "book_attrs",
        "book_status",
        "id",
        "title",
        "user_id"
      ],
      "properties": {
        "author": {
          "type": "string",
          "maxLength": 255
        },
        "book_attrs": {
          "$ref": "#/definitions/models.BookAttrs"
        },
        "book_status": {
          "type": "integer"
        },
        "created_at": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "title": {
          "type": "string",
          "maxLength": 255
        },
        "updated_at": {
          "type": "string"
        },
        "user_id": {
          "type": "string"
        }
      }
    },
    "models.BookAttrs": {
      "type": "object",
      "properties": {
        "description": {
          "type": "string"
        },
        "picture": {
          "type": "string"
        },
        "rating": {
          "type": "integer",
          "maximum": 10,
          "minimum": 1
        }
      }
    }
  },
  "securityDefinitions": {
    "ApiKeyAuth": {
      "type": "apiKey",
      "name": "Authorization",
      "in": "header"
    }
  }
}