{
  "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-kappa.vercel.app",
  "basePath": "/",
  "schemes": [
    "https"
  ],
  "paths": {
    "/user/": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "List Users",
        "description": "\r  You can send query with endpoint for search[], sort[], page and limit.\r  <ul> Examples:\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"
                },
                "password": {
                  "type": "string",
                  "example": "123456"
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      }
    },
    "/user/{userId}": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get Single User",
        "description": "",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      },
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "Update User",
        "description": "",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "email": {
                  "type": "string",
                  "example": "test"
                },
                "password": {
                  "type": "string",
                  "example": "123456"
                }
              }
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      },
      "delete": {
        "tags": [
          "Users"
        ],
        "summary": "Delete User",
        "description": "",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found"
          }
        }
      },
      "patch": {
        "tags": [
          "Users"
        ],
        "summary": "Update User",
        "description": "",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "email": {
                  "type": "string",
                  "example": "test"
                },
                "password": {
                  "type": "string",
                  "example": "123456"
                }
              }
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      }
    },
    "/user/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"
                },
                "password": {
                  "type": "string",
                  "example": "123456"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/user/logout": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Logout",
        "description": "",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/products/": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "List Products",
        "description": "\r  You can send query with endpoint for search[], sort[], page and limit.\r  <ul> Examples:\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/{productId}": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Get Single Product",
        "description": "",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      },
      "put": {
        "tags": [
          "Products"
        ],
        "summary": "Update Product",
        "description": "",
        "parameters": [
          {
            "name": "productId",
            "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": "productId",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found"
          }
        }
      },
      "patch": {
        "tags": [
          "Products"
        ],
        "summary": "Update Product",
        "description": "",
        "parameters": [
          {
            "name": "productId",
            "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"
          }
        }
      }
    },
    "/categories/": {
      "get": {
        "tags": [
          "Categories"
        ],
        "summary": "List Categories",
        "description": "\r  You can send query with endpoint for search[], sort[], page and limit.\r  <ul> Examples:\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": "Test Category"
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      }
    },
    "/categories/{categoryId}": {
      "get": {
        "tags": [
          "Categories"
        ],
        "summary": "Get Single Category",
        "description": "",
        "parameters": [
          {
            "name": "categoryId",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      },
      "put": {
        "tags": [
          "Categories"
        ],
        "summary": "Update Category",
        "description": "",
        "parameters": [
          {
            "name": "categoryId",
            "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": "categoryId",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found"
          }
        }
      },
      "patch": {
        "tags": [
          "Categories"
        ],
        "summary": "Update Category",
        "description": "",
        "parameters": [
          {
            "name": "categoryId",
            "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"
          }
        }
      }
    }
  },
  "definitions": {
    "/login": {
      "type": "object",
      "properties": {
        "email": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "example": "String"
            },
            "required": {
              "type": "boolean",
              "example": true
            }
          }
        },
        "password": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "example": "String"
            },
            "required": {
              "type": "boolean",
              "example": true
            }
          }
        }
      }
    },
    "Product": {
      "type": "object",
      "properties": {
        "category": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "ref": {
              "type": "string",
              "example": "Category"
            },
            "required": {
              "type": "boolean",
              "example": true
            }
          }
        },
        "title": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "trim": {
              "type": "boolean",
              "example": true
            },
            "required": {
              "type": "boolean",
              "example": true
            }
          }
        },
        "description": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "trim": {
              "type": "boolean",
              "example": true
            },
            "required": {
              "type": "boolean",
              "example": true
            }
          }
        },
        "price": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "required": {
              "type": "boolean",
              "example": true
            }
          }
        },
        "discountPercentage": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "required": {
              "type": "boolean",
              "example": true
            }
          }
        },
        "rating": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "required": {
              "type": "boolean",
              "example": true
            }
          }
        },
        "stock": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "required": {
              "type": "boolean",
              "example": true
            }
          }
        },
        "brand": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "trim": {
              "type": "boolean",
              "example": true
            },
            "required": {
              "type": "boolean",
              "example": true
            }
          }
        },
        "thumbnail": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "required": {
              "type": "boolean",
              "example": true
            },
            "validate": {
              "type": "array",
              "example": [
                null,
                "Please enter a valid URL"
              ],
              "items": {
                "type": "string"
              }
            }
          }
        },
        "images": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "type": {
                "type": "function"
              },
              "validate": {
                "type": "array",
                "example": [
                  null,
                  "Please enter a valid URL"
                ],
                "items": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "Category": {
      "type": "object",
      "properties": {
        "name": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "trim": {
              "type": "boolean",
              "example": true
            },
            "required": {
              "type": "boolean",
              "example": true
            }
          }
        }
      }
    }
  }
}