{
  "swagger": "2.0",
  "info": {
    "version": "1.0.0",
    "title": "REST API",
    "description": "",
    "termsOfService": "https://furkandogu.vercel.app/",
    "contact": {
      "name": "Furkan",
      "email": "furkandogu2018@gmail.com"
    },
    "license": {
      "name": "ISC"
    }
  },
  "host": "https://blog-app-api-iota.vercel.app",
  "basePath": "/",
  "schemes": [
    "https"
  ],
  "securityDefinitions": {
    "Token": {
      "type": "apiKey",
      "in": "header",
      "name": "Authorization",
      "description": "Simple Token Authentication * Example: <b>Token ...tokenKey...</b>"
    }
  },
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/auth/login": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Login",
        "description": "Login with email and password",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "email": {
                  "type": "string",
                  "example": "test@test.com"
                },
                "password": {
                  "type": "string",
                  "example": "test"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/auth/logout": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "summary": "Logout",
        "description": "",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/users/": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "List Users",
        "description": "\r  You can send query with endpoint for filter[], search[], sort[], page and limit.\r  <ul> Examples:\r   <li>URL/?<b>filter[field1]=value1&filter[field2]=value2</b></li>\r   <li>URL/?<b>search[field1]=value1&search[field2]=value2</b></li>\r   <li>URL/?<b>sort[field1]=1&sort[field2]=-1</b></li>\r   <li>URL/?<b>page=2&limit=1</b></li>\r  </ul>\r  ",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Create User",
        "description": "",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "username": {
                  "type": "string",
                  "example": "test"
                },
                "password": {
                  "type": "string",
                  "example": "1234"
                },
                "email": {
                  "type": "string",
                  "example": "test@site.com"
                },
                "firstName": {
                  "type": "string",
                  "example": "test"
                },
                "lastName": {
                  "type": "string",
                  "example": "test"
                },
                "image": {
                  "type": "string",
                  "example": "https://wwww......"
                },
                "city": {
                  "type": "string",
                  "example": "test"
                },
                "bio": {
                  "type": "string",
                  "example": "test"
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      }
    },
    "/users/{id}": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get Single User",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "Update User",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "username": {
                  "type": "string",
                  "example": "test"
                },
                "password": {
                  "type": "string",
                  "example": "1234"
                },
                "email": {
                  "type": "string",
                  "example": "test@site.com"
                },
                "firstName": {
                  "type": "string",
                  "example": "test"
                },
                "lastName": {
                  "type": "string",
                  "example": "test"
                },
                "image": {
                  "type": "string",
                  "example": "https://wwww......"
                },
                "city": {
                  "type": "string",
                  "example": "test"
                },
                "bio": {
                  "type": "string",
                  "example": "test"
                }
              }
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      },
      "delete": {
        "tags": [
          "Users"
        ],
        "summary": "Delete User",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found"
          }
        }
      },
      "patch": {
        "tags": [
          "Users"
        ],
        "summary": "Update User",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "username": {
                  "type": "string",
                  "example": "test"
                },
                "password": {
                  "type": "string",
                  "example": "1234"
                },
                "email": {
                  "type": "string",
                  "example": "test@site.com"
                },
                "firstName": {
                  "type": "string",
                  "example": "test"
                },
                "lastName": {
                  "type": "string",
                  "example": "test"
                },
                "image": {
                  "type": "string",
                  "example": "https://wwww......"
                },
                "city": {
                  "type": "string",
                  "example": "test"
                },
                "bio": {
                  "type": "string",
                  "example": "test"
                }
              }
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      }
    },
    "/categories/": {
      "get": {
        "tags": [
          "Categories"
        ],
        "summary": "List Categories",
        "description": "\r  You can send query with endpoint for filter[], search[], sort[], page and limit.\r  <ul> Examples:\r   <li>URL/?<b>filter[field1]=value1&filter[field2]=value2</b></li>\r   <li>URL/?<b>search[field1]=value1&search[field2]=value2</b></li>\r   <li>URL/?<b>sort[field1]=1&sort[field2]=-1</b></li>\r   <li>URL/?<b>page=2&limit=1</b></li>\r  </ul>\r  ",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "tags": [
          "Categories"
        ],
        "summary": "Create Category",
        "description": "",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "example": "category"
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      }
    },
    "/categories/{id}": {
      "get": {
        "tags": [
          "Categories"
        ],
        "summary": "Get Single Category",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "put": {
        "tags": [
          "Categories"
        ],
        "summary": "Update Category",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "example": "category"
                }
              }
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      },
      "delete": {
        "tags": [
          "Categories"
        ],
        "summary": "Delete Category",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found"
          }
        }
      },
      "patch": {
        "tags": [
          "Categories"
        ],
        "summary": "Update Category",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "example": "category"
                }
              }
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      }
    },
    "/blogs/": {
      "get": {
        "tags": [
          "Blogs"
        ],
        "summary": "List Blogs",
        "description": "\r  You can use <u>filter[] & search[] & sort[] & page & limit</u> queries with endpoint.\r  <ul> Examples:\r   <li>URL/?<b>filter[field1]=value1&filter[field2]=value2</b></li>\r   <li>URL/?<b>search[field1]=value1&search[field2]=value2</b></li>\r   <li>URL/?<b>sort[field1]=asc&sort[field2]=desc</b></li>\r   <li>URL/?<b>limit=10&page=1</b></li>\r  </ul>\r  ",
        "parameters": [
          {
            "name": "author",
            "in": "query",
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "tags": [
          "Blogs"
        ],
        "summary": "Create Blog",
        "description": "",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "categoryId": {
                  "type": "string",
                  "example": "65343222b67e9681f937f101"
                },
                "title": {
                  "type": "string",
                  "example": "Blog Title 1"
                },
                "content": {
                  "type": "string",
                  "example": "Blog Content 1"
                },
                "image": {
                  "type": "string",
                  "example": "http://imageURL"
                },
                "isPublish": {
                  "type": "boolean",
                  "example": true
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      }
    },
    "/blogs/{id}": {
      "get": {
        "tags": [
          "Blogs"
        ],
        "summary": "Get Single Blog",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "put": {
        "tags": [
          "Blogs"
        ],
        "summary": "Update Blog",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "example": "Blog 1"
                }
              }
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      },
      "delete": {
        "tags": [
          "Blogs"
        ],
        "summary": "Delete Blog",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found"
          }
        }
      },
      "patch": {
        "tags": [
          "Blogs"
        ],
        "summary": "Update Blog",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "example": "Blog 1"
                }
              }
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      }
    },
    "/blogs/{id}/getLike": {
      "get": {
        "tags": [
          "Blogs"
        ],
        "summary": "Get Like Info",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/blogs/{id}/postLike": {
      "post": {
        "tags": [
          "Blogs"
        ],
        "summary": "Add/Remove Like",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/comments/": {
      "get": {
        "tags": [
          "Comments"
        ],
        "summary": "List Comments",
        "description": "\r  You can use <u>filter[] & search[] & sort[] & page & limit</u> queries with endpoint.\r  <ul> Examples:\r   <li>URL/?<b>filter[field1]=value1&filter[field2]=value2</b></li>\r   <li>URL/?<b>search[field1]=value1&search[field2]=value2</b></li>\r   <li>URL/?<b>sort[field1]=asc&sort[field2]=desc</b></li>\r   <li>URL/?<b>limit=10&page=1</b></li>\r  </ul>\r  ",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "tags": [
          "Comments"
        ],
        "summary": "Create Comment",
        "description": "",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "blogId": {
                  "type": "string",
                  "example": "65343222b67e9681f937f201"
                },
                "comment": {
                  "type": "string",
                  "example": "Comment 1"
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      }
    },
    "/comments/{id}": {
      "get": {
        "tags": [
          "Comments"
        ],
        "summary": "Get Single Comment",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "put": {
        "tags": [
          "Comments"
        ],
        "summary": "Update Comment",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "example": "Comment 1"
                }
              }
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      },
      "delete": {
        "tags": [
          "Comments"
        ],
        "summary": "Delete Comment",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found"
          }
        }
      },
      "patch": {
        "tags": [
          "Comments"
        ],
        "summary": "Update Comment",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "example": "Comment 1"
                }
              }
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      }
    }
  },
  "security": [
    {
      "Token": []
    }
  ]
}