{
  "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://product-api-2.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": {
    "/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": {
                "email": {
                  "type": "string",
                  "example": "test@test.com"
                },
                "password": {
                  "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": {
                "email": {
                  "type": "string",
                  "example": "test@test.com"
                },
                "password": {
                  "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": {
                "email": {
                  "type": "string",
                  "example": "test@test.com"
                },
                "password": {
                  "type": "string",
                  "example": "test"
                }
              }
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      }
    },
    "/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"
          }
        }
      }
    },
    "/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": "Test 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": "Test Category"
                }
              }
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      }
    },
    "/products/": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "List Products",
        "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": [
          "Products"
        ],
        "summary": "Create Product",
        "description": "",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "category": {
                  "type": "string",
                  "example": "661aee14a06755ee921e79f4"
                },
                "title": {
                  "type": "string",
                  "example": "title"
                },
                "description": {
                  "type": "string",
                  "example": "description"
                },
                "price": {
                  "type": "number",
                  "example": 123
                },
                "discountPercentage": {
                  "type": "number",
                  "example": 12.96
                },
                "rating": {
                  "type": "number",
                  "example": 1.23
                },
                "stock": {
                  "type": "number",
                  "example": 50
                },
                "brand": {
                  "type": "string",
                  "example": "brand"
                },
                "thumbnail": {
                  "type": "string",
                  "example": "https://www.thumbnail.com/thumbnail.jpg"
                },
                "images": {
                  "type": "array",
                  "example": [
                    "https://www.image.com/image.jpg",
                    "https://www.image.com/image.jpg",
                    "https://www.image.com/image.jpg"
                  ],
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      }
    },
    "/products/{id}": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Get Single Product",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "put": {
        "tags": [
          "Products"
        ],
        "summary": "Update Product",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "category": {
                  "type": "string",
                  "example": "661aee14a06755ee921e79f4"
                },
                "title": {
                  "type": "string",
                  "example": "title"
                },
                "description": {
                  "type": "string",
                  "example": "description"
                },
                "price": {
                  "type": "number",
                  "example": 123
                },
                "discountPercentage": {
                  "type": "number",
                  "example": 12.96
                },
                "rating": {
                  "type": "number",
                  "example": 1.23
                },
                "stock": {
                  "type": "number",
                  "example": 50
                },
                "brand": {
                  "type": "string",
                  "example": "brand"
                },
                "thumbnail": {
                  "type": "string",
                  "example": "https://www.thumbnail.com/thumbnail.jpg"
                },
                "images": {
                  "type": "array",
                  "example": [
                    "https://www.image.com/image.jpg",
                    "https://www.image.com/image.jpg",
                    "https://www.image.com/image.jpg"
                  ],
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      },
      "delete": {
        "tags": [
          "Products"
        ],
        "summary": "Delete Product",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found"
          }
        }
      },
      "patch": {
        "tags": [
          "Products"
        ],
        "summary": "Update Product",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "category": {
                  "type": "string",
                  "example": "661aee14a06755ee921e79f4"
                },
                "title": {
                  "type": "string",
                  "example": "title"
                },
                "description": {
                  "type": "string",
                  "example": "description"
                },
                "price": {
                  "type": "number",
                  "example": 123
                },
                "discountPercentage": {
                  "type": "number",
                  "example": 12.96
                },
                "rating": {
                  "type": "number",
                  "example": 1.23
                },
                "stock": {
                  "type": "number",
                  "example": 50
                },
                "brand": {
                  "type": "string",
                  "example": "brand"
                },
                "thumbnail": {
                  "type": "string",
                  "example": "https://www.thumbnail.com/thumbnail.jpg"
                },
                "images": {
                  "type": "array",
                  "example": [
                    "https://www.image.com/image.jpg",
                    "https://www.image.com/image.jpg",
                    "https://www.image.com/image.jpg"
                  ],
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      }
    }
  },
  "security": [
    {
      "Token": []
    }
  ]
}