{
    "openapi": "3.0.0",
    "info": {
      "title": "Slider API",
      "version": "1.0.0",
      "description": "API for managing sliders"
    },
    "servers": [
      {
        "url": "http://localhost:3000",
        "description": "Local server"
      }
    ],
    "paths": {
      "/sliders": {
        "post": {
          "summary": "Create a new slider",
          "tags": ["Sliders"],
          "requestBody": {
            "required": true,
            "content": {
              "multipart/form-data": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Summer Sale"
                    },
                    "description": {
                      "type": "string",
                      "example": "Discounts on all items"
                    },
                    "image": {
                      "type": "string",
                      "format": "binary"
                    }
                  },
                  "required": ["title", "description"]
                }
              }
            }
          },
          "responses": {
            "201": {
              "description": "Slider created successfully",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "message": {
                        "type": "string",
                        "example": "Slider created successfully"
                      },
                      "slider": {
                        "$ref": "#/components/schemas/Slider"
                      }
                    }
                  }
                }
              }
            },
            "500": {
              "description": "Server error",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/Error"
                  }
                }
              }
            }
          }
        },
        "get": {
          "summary": "Get all sliders",
          "tags": ["Sliders"],
          "responses": {
            "200": {
              "description": "List of sliders",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/Slider"
                    }
                  }
                }
              }
            },
            "500": {
              "description": "Server error",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/Error"
                  }
                }
              }
            }
          }
        }
      },
      "/sliders/{id}": {
        "get": {
          "summary": "Get a slider by ID",
          "tags": ["Sliders"],
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "example": "1"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "Slider retrieved successfully",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/Slider"
                  }
                }
              }
            },
            "404": {
              "description": "Slider not found",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/Error"
                  }
                }
              }
            },
            "500": {
              "description": "Server error",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/Error"
                  }
                }
              }
            }
          }
        },
        "put": {
          "summary": "Update a slider",
          "tags": ["Sliders"],
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "example": "1"
              }
            }
          ],
          "requestBody": {
            "required": false,
            "content": {
              "multipart/form-data": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "New Slider Title"
                    },
                    "description": {
                      "type": "string",
                      "example": "Updated description"
                    },
                    "image": {
                      "type": "string",
                      "format": "binary"
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "Slider updated successfully",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "message": {
                        "type": "string",
                        "example": "Slider updated successfully"
                      },
                      "slider": {
                        "$ref": "#/components/schemas/Slider"
                      }
                    }
                  }
                }
              }
            },
            "404": {
              "description": "Slider not found",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/Error"
                  }
                }
              }
            },
            "500": {
              "description": "Server error",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/Error"
                  }
                }
              }
            }
          }
        },
        "delete": {
          "summary": "Delete a slider",
          "tags": ["Sliders"],
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "example": "1"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "Slider deleted successfully",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "message": {
                        "type": "string",
                        "example": "Slider deleted successfully"
                      }
                    }
                  }
                }
              }
            },
            "404": {
              "description": "Slider not found",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/Error"
                  }
                }
              }
            },
            "500": {
              "description": "Server error",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/Error"
                  }
                }
              }
            }
          }
        }
      }
    },
    "components": {
      "schemas": {
        "Slider": {
          "type": "object",
          "properties": {
            "id": {
              "type": "integer",
              "example": 1
            },
            "title": {
              "type": "string",
              "example": "Slider Title"
            },
            "description": {
              "type": "string",
              "example": "Slider Description"
            },
            "image": {
              "type": "string",
              "example": "uploads/sliders/1637101234.jpg"
            },
            "createdAt": {
              "type": "string",
              "format": "date-time",
              "example": "2024-09-24T10:30:00Z"
            },
            "updatedAt": {
              "type": "string",
              "format": "date-time",
              "example": "2024-09-24T12:00:00Z"
            }
          }
        },
        "Error": {
          "type": "object",
          "properties": {
            "message": {
              "type": "string",
              "example": "Error message"
            },
            "error": {
              "type": "string",
              "example": "Detailed error message"
            }
          }
        }
      }
    }
  }
  