{
  "openapi": "3.1.0",
  "info": {
    "title": "DocuWriter.ai REST API",
    "version": "1.0.0",
    "description": "REST API for generating code documentation, tests, comments, UML diagrams, Swagger/OpenAPI specs, and managing DocuWriter.ai Spaces.",
    "termsOfService": "https://www.docuwriter.ai/terms"
  },
  "servers": [
    {
      "url": "https://app.docuwriter.ai/api"
    }
  ],
  "externalDocs": {
    "description": "DocuWriter.ai API documentation",
    "url": "https://docs.docuwriter.ai/docuwriterai-api-docs/api-reference/start-with-the-api/public-api-quickstart"
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "GenerationRequest": {
        "type": "object",
        "additionalProperties": true
      },
      "GenerationResponse": {
        "type": "object",
        "additionalProperties": true
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/generate-code-documentation": {
      "post": {
        "summary": "Generate code documentation",
        "operationId": "generateCodeDocumentation",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Generated documentation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerationResponse"
                }
              }
            }
          }
        }
      }
    },
    "/generate-multi-file-documentation": {
      "post": {
        "summary": "Generate documentation from multiple files",
        "operationId": "generateMultiFileDocumentation",
        "responses": {
          "200": {
            "description": "Generated documentation"
          }
        }
      }
    },
    "/generate-swagger-api": {
      "post": {
        "summary": "Generate Swagger/OpenAPI documentation",
        "operationId": "generateSwaggerApi",
        "responses": {
          "200": {
            "description": "Generated API specification"
          }
        }
      }
    },
    "/generate-uml-diagram": {
      "post": {
        "summary": "Generate UML diagrams",
        "operationId": "generateUmlDiagram",
        "responses": {
          "200": {
            "description": "Generated UML diagram"
          }
        }
      }
    },
    "/spaces": {
      "get": {
        "summary": "List Spaces",
        "operationId": "listSpaces",
        "responses": {
          "200": {
            "description": "Spaces list"
          }
        }
      },
      "post": {
        "summary": "Create a Space",
        "operationId": "createSpace",
        "responses": {
          "200": {
            "description": "Created Space"
          }
        }
      }
    },
    "/spaces/{space}/documents": {
      "get": {
        "summary": "List Space documents",
        "operationId": "listSpaceDocuments",
        "parameters": [
          {
            "name": "space",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Document list"
          }
        }
      },
      "post": {
        "summary": "Create a Space document",
        "operationId": "createSpaceDocument",
        "parameters": [
          {
            "name": "space",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Created document"
          }
        }
      }
    },
    "/spaces/{space}/search": {
      "post": {
        "summary": "Search documents in a Space",
        "operationId": "searchSpaceDocuments",
        "parameters": [
          {
            "name": "space",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search results"
          }
        }
      }
    },
    "/generations": {
      "get": {
        "summary": "List generations",
        "operationId": "listGenerations",
        "responses": {
          "200": {
            "description": "Generations list"
          }
        }
      }
    },
    "/repositories": {
      "get": {
        "summary": "List connected repositories",
        "operationId": "listRepositories",
        "responses": {
          "200": {
            "description": "Repositories list"
          }
        }
      }
    }
  }
}