{
    "openapi": "3.0.0",
    "info": {
      "title": "Blog API",
      "description": "This is a simple API for managing blogs with CRUD operations.",
      "version": "1.0.0"
    },
    "servers": [
      {
        "url": "https://backend.abyssiniasoftware.com/",
        "description": "Local server"
      }
    ],
    "paths": {
      "/blogs": {
        "get": {
          "summary": "Get all blogs",
          "description": "Retrieve a list of all blogs.",
          "responses": {
            "200": {
              "description": "A list of blogs.",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/Blog"
                    }
                  }
                }
              }
            }
          }
        },
        "post": {
          "summary": "Create a new blog",
          "description": "Create a new blog with title, description, date, and category.",
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlogInput"
                }
              }
            }
          },
          "responses": {
            "201": {
              "description": "Blog created successfully.",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/Blog"
                  }
                }
              }
            },
            "400": {
              "description": "Invalid input."
            }
          }
        }
      },
      "/blogs/{id}": {
        "get": {
          "summary": "Get a blog by ID",
          "description": "Retrieve a single blog by its ID.",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "description": "ID of the blog to retrieve",
              "schema": {
                "type": "integer"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "Blog retrieved successfully.",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/Blog"
                  }
                }
              }
            },
            "404": {
              "description": "Blog not found."
            }
          }
        },
        "put": {
          "summary": "Update a blog",
          "description": "Update the details of an existing blog.",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "description": "ID of the blog to update",
              "schema": {
                "type": "integer"
              }
            }
          ],
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlogInput"
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "Blog updated successfully.",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/Blog"
                  }
                }
              }
            },
            "404": {
              "description": "Blog not found."
            },
            "400": {
              "description": "Invalid input."
            }
          }
        },
        "delete": {
          "summary": "Delete a blog",
          "description": "Delete a blog by its ID.",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "description": "ID of the blog to delete",
              "schema": {
                "type": "integer"
              }
            }
          ],
          "responses": {
            "204": {
              "description": "Blog deleted successfully."
            },
            "404": {
              "description": "Blog not found."
            }
          }
        }
      }
    },
    "components": {
      "schemas": {
        "Blog": {
          "type": "object",
          "properties": {
            "id": {
              "type": "integer",
              "description": "ID of the blog"
            },
            "title": {
              "type": "string",
              "description": "Title of the blog"
            },
            "description": {
              "type": "string",
              "description": "Description of the blog"
            },
            "date": {
              "type": "string",
              "format": "date",
              "description": "Publication date of the blog"
            },
            "category": {
              "type": "string",
              "description": "Category of the blog"
            }
          }
        },
        "BlogInput": {
          "type": "object",
          "required": ["title", "description", "date", "category"],
          "properties": {
            "title": {
              "type": "string",
              "description": "Title of the blog"
            },
            "description": {
              "type": "string",
              "description": "Description of the blog"
            },
            "date": {
              "type": "string",
              "format": "date",
              "description": "Publication date of the blog"
            },
            "category": {
              "type": "string",
              "description": "Category of the blog"
            }
          }
        }
      }
    }
  }
  