{
    "openapi": "3.0.0",
    "info": {
      "title": "FAQ API",
      "version": "1.0.0",
      "description": "API documentation for managing FAQs"
    },
    "servers": [
      {
        "url": "http://localhost:3002",
        "description": "Local server"
      }
    ],
    "paths": {
      "/api/faq": {
        "post": {
          "summary": "Create a new FAQ",
          "description": "Creates a new FAQ entry",
          "tags": ["FAQs"],
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "question": {
                      "type": "string",
                      "example": "What is Swagger?"
                    },
                    "answer": {
                      "type": "string",
                      "example": "Swagger is a tool for API documentation."
                    }
                  },
                  "required": ["question", "answer"]
                }
              }
            }
          },
          "responses": {
            "201": {
              "description": "FAQ created successfully",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "message": {
                        "type": "string",
                        "example": "FAQ created successfully"
                      },
                      "faq": {
                        "$ref": "#/components/schemas/FAQ"
                      }
                    }
                  }
                }
              }
            },
            "500": {
              "description": "Server error",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "message": {
                        "type": "string",
                        "example": "Server error"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "get": {
          "summary": "Get all FAQs",
          "description": "Returns a list of all FAQs",
          "tags": ["FAQs"],
          "responses": {
            "200": {
              "description": "List of FAQs",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "faqs": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/FAQ"
                        }
                      }
                    }
                  }
                }
              }
            },
            "500": {
              "description": "Server error",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "message": {
                        "type": "string",
                        "example": "Server error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "/api/faq/{id}": {
        "get": {
          "summary": "Get a single FAQ by ID",
          "description": "Returns a single FAQ based on the provided ID",
          "tags": ["FAQs"],
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "description": "ID of the FAQ to retrieve",
              "schema": {
                "type": "string"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "A single FAQ",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/FAQ"
                  }
                }
              }
            },
            "404": {
              "description": "FAQ not found",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "message": {
                        "type": "string",
                        "example": "FAQ not found"
                      }
                    }
                  }
                }
              }
            },
            "500": {
              "description": "Server error",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "message": {
                        "type": "string",
                        "example": "Server error"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "put": {
          "summary": "Update a FAQ by ID",
          "description": "Updates an existing FAQ entry based on the provided ID",
          "tags": ["FAQs"],
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "description": "ID of the FAQ to update",
              "schema": {
                "type": "string"
              }
            }
          ],
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "question": {
                      "type": "string",
                      "example": "What is Swagger?"
                    },
                    "answer": {
                      "type": "string",
                      "example": "Swagger is a tool for API documentation."
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "FAQ updated successfully",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "message": {
                        "type": "string",
                        "example": "FAQ updated successfully"
                      },
                      "faq": {
                        "$ref": "#/components/schemas/FAQ"
                      }
                    }
                  }
                }
              }
            },
            "404": {
              "description": "FAQ not found",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "message": {
                        "type": "string",
                        "example": "FAQ not found"
                      }
                    }
                  }
                }
              }
            },
            "500": {
              "description": "Server error",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "message": {
                        "type": "string",
                        "example": "Server error"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "delete": {
          "summary": "Delete a FAQ by ID",
          "description": "Deletes a FAQ entry based on the provided ID",
          "tags": ["FAQs"],
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "description": "ID of the FAQ to delete",
              "schema": {
                "type": "string"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "FAQ deleted successfully",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "message": {
                        "type": "string",
                        "example": "FAQ deleted successfully"
                      }
                    }
                  }
                }
              }
            },
            "404": {
              "description": "FAQ not found",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "message": {
                        "type": "string",
                        "example": "FAQ not found"
                      }
                    }
                  }
                }
              }
            },
            "500": {
              "description": "Server error",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "message": {
                        "type": "string",
                        "example": "Server error"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "components": {
      "schemas": {
        "FAQ": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "example": "1"
            },
            "question": {
              "type": "string",
              "example": "What is Swagger?"
            },
            "answer": {
              "type": "string",
              "example": "Swagger is a tool for API documentation."
            }
          }
        }
      }
    }
  }
  