{
  "openapi": "3.1.0",
  "info": {
    "title": "fbb.sh API",
    "version": "1.2.0",
    "description": "Read-only discovery API for the public fbb.sh profile. Unknown API routes and unsupported methods use RFC 9457 Problem Details with stable code, message, and hint fields."
  },
  "servers": [
    {
      "url": "https://fbb.sh/api/v1",
      "description": "fbb.sh public API v1"
    }
  ],
  "security": [],
  "paths": {
    "/": {
      "get": {
        "operationId": "getApiIndex",
        "summary": "Get the fbb.sh API index",
        "description": "Returns canonical URLs for the public profile and developer discovery resources.",
        "responses": {
          "200": {
            "description": "fbb.sh API index",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiIndex"
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          }
        }
      },
      "head": {
        "operationId": "headApiIndex",
        "summary": "Inspect the fbb.sh API index",
        "description": "Returns the API index response headers without a body.",
        "responses": {
          "200": {
            "description": "fbb.sh API index headers"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          }
        }
      }
    }
  },
  "components": {
    "responses": {
      "NotFound": {
        "description": "The requested API resource does not exist",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "MethodNotAllowed": {
        "description": "The HTTP method is not supported",
        "headers": {
          "Allow": {
            "schema": {
              "type": "string",
              "const": "GET, HEAD"
            }
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      }
    },
    "schemas": {
      "ApiIndex": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "version",
          "description",
          "profile",
          "developer"
        ],
        "properties": {
          "name": {
            "type": "string",
            "const": "fbb.sh"
          },
          "version": {
            "type": "string",
            "const": "v1"
          },
          "description": {
            "type": "string"
          },
          "profile": {
            "$ref": "#/components/schemas/ProfileLinks"
          },
          "developer": {
            "$ref": "#/components/schemas/DeveloperLinks"
          }
        }
      },
      "ProfileLinks": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "html",
          "markdown"
        ],
        "properties": {
          "html": {
            "type": "string",
            "format": "uri"
          },
          "markdown": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "DeveloperLinks": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "documentation",
          "openapi",
          "apiCatalog",
          "llms"
        ],
        "properties": {
          "documentation": {
            "type": "string",
            "format": "uri"
          },
          "openapi": {
            "type": "string",
            "format": "uri"
          },
          "apiCatalog": {
            "type": "string",
            "format": "uri"
          },
          "llms": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "Problem": {
        "type": "object",
        "description": "RFC 9457 Problem Details extended with stable fbb.sh resolution fields.",
        "required": [
          "type",
          "title",
          "status",
          "code",
          "message",
          "detail",
          "hint",
          "instance"
        ],
        "properties": {
          "type": {
            "type": "string",
            "format": "uri-reference"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer",
            "minimum": 400,
            "maximum": 599
          },
          "code": {
            "type": "string",
            "description": "Stable machine-readable fbb.sh error code."
          },
          "message": {
            "type": "string",
            "description": "Short human-readable error message."
          },
          "detail": {
            "type": "string"
          },
          "hint": {
            "type": "string",
            "description": "Concrete next step or discovery URL."
          },
          "instance": {
            "type": "string",
            "format": "uri-reference"
          }
        }
      }
    }
  }
}
