{
  "openapi": "3.1.2",
  "info": {
    "title": "Fictional Library API",
    "version": "1.2.0",
    "description": "Synthetic fixture for MCP Forge. It does not describe a real service."
  },
  "servers": [
    { "url": "https://library-api.example.invalid/v1" }
  ],
  "security": [
    { "bearerAuth": [] }
  ],
  "paths": {
    "/books": {
      "get": {
        "operationId": "search-books",
        "summary": "Search books",
        "description": "Search the fictional catalogue by text and optional limit.",
        "security": [],
        "parameters": [
          { "name": "q", "in": "query", "required": true, "description": "Search text", "schema": { "type": "string", "minLength": 1 } },
          { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100 } }
        ],
        "responses": { "200": { "description": "Matching books" } }
      },
      "post": {
        "operationId": "add-book",
        "summary": "Add a book",
        "description": "Create a book record in the fictional catalogue.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/BookInput" }
            }
          }
        },
        "responses": {
          "201": { "description": "Book created" },
          "400": { "description": "Invalid input" }
        }
      }
    },
    "/books/{bookId}": {
      "parameters": [
        { "name": "bookId", "in": "path", "required": true, "schema": { "type": "string" } }
      ],
      "get": {
        "operationId": "search-books",
        "summary": "Get a book",
        "description": "Read one fictional book. This intentionally duplicates an operationId.",
        "security": [],
        "responses": {
          "200": { "description": "Book record" },
          "404": { "description": "Not found" }
        }
      },
      "delete": {
        "operationId": "delete-book",
        "summary": "Delete a book",
        "description": "Delete one fictional book record; destructive review is required.",
        "responses": {
          "204": { "description": "Deleted" },
          "404": { "description": "Not found" }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "opaque" }
    },
    "schemas": {
      "BookInput": {
        "type": "object",
        "required": ["title", "author"],
        "properties": {
          "title": { "type": "string", "minLength": 1 },
          "author": { "type": "string", "minLength": 1 },
          "year": { "type": "integer", "minimum": 1400, "maximum": 2100 },
          "tags": { "type": "array", "items": { "type": "string" } }
        }
      }
    }
  }
}
