{
  "openapi": "3.1.0",
  "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema",
  "info": {
    "title": "QRL Developer Resources API",
    "summary": "Official QRL developer-resource discovery API",
    "description": "A public, read-only catalog of official developer resources for The Quantum Resistant Ledger (QRL). This API describes resources published by theqrl.org; blockchain node APIs are documented separately in the returned catalog.",
    "version": "1.0.0",
    "termsOfService": "https://www.theqrl.org/terms/",
    "contact": {
      "name": "QRL developer support",
      "url": "https://www.theqrl.org/developers/",
      "email": "support@theqrl.org"
    }
  },
  "servers": [
    {
      "url": "https://www.theqrl.org",
      "description": "QRL production website"
    }
  ],
  "security": [],
  "tags": [
    {
      "name": "Discovery",
      "description": "Machine-readable entry points for official QRL developer resources."
    }
  ],
  "paths": {
    "/api": {
      "get": {
        "tags": [
          "Discovery"
        ],
        "summary": "Get the QRL developer API index",
        "description": "Returns links to this OpenAPI description, human-readable documentation, and the versioned developer-resource catalog.",
        "operationId": "getQrlDeveloperApiIndex",
        "responses": {
          "200": {
            "$ref": "#/components/responses/ApiIndexResponse"
          },
          "4XX": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "head": {
        "tags": [
          "Discovery"
        ],
        "summary": "Inspect the QRL developer API index response",
        "operationId": "headQrlDeveloperApiIndex",
        "responses": {
          "200": {
            "$ref": "#/components/responses/HeadResponse"
          },
          "4XX": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "options": {
        "tags": [
          "Discovery"
        ],
        "summary": "Inspect supported methods for the QRL developer API index",
        "operationId": "optionsQrlDeveloperApiIndex",
        "responses": {
          "204": {
            "$ref": "#/components/responses/OptionsResponse"
          },
          "4XX": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/v1/resources": {
      "get": {
        "tags": [
          "Discovery"
        ],
        "summary": "List official QRL developer resources",
        "description": "Returns stable identifiers and canonical URLs for QRL documentation, node API documentation, source code, and improvement proposals.",
        "operationId": "listQrlDeveloperResources",
        "responses": {
          "200": {
            "$ref": "#/components/responses/DeveloperResourcesResponse"
          },
          "4XX": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "head": {
        "tags": [
          "Discovery"
        ],
        "summary": "Inspect the QRL developer-resource catalog response",
        "operationId": "headQrlDeveloperResources",
        "responses": {
          "200": {
            "$ref": "#/components/responses/HeadResponse"
          },
          "4XX": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "options": {
        "tags": [
          "Discovery"
        ],
        "summary": "Inspect supported methods for the QRL developer-resource catalog",
        "operationId": "optionsQrlDeveloperResources",
        "responses": {
          "204": {
            "$ref": "#/components/responses/OptionsResponse"
          },
          "4XX": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    }
  },
  "components": {
    "responses": {
      "ApiIndexResponse": {
        "description": "QRL developer API index",
        "headers": {
          "Link": {
            "description": "RFC 8631 links to the OpenAPI service description and human-readable service documentation.",
            "schema": {
              "type": "string"
            }
          },
          "X-API-Version": {
            "description": "Version of this website API.",
            "schema": {
              "type": "string",
              "const": "1.0.0"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiIndex"
            },
            "example": {
              "name": "QRL Developer Resources API",
              "description": "A no-auth catalog of official QRL developer resources published on theqrl.org.",
              "api_version": "1.0.0",
              "links": {
                "self": "https://www.theqrl.org/api",
                "developer_resources": "https://www.theqrl.org/api/v1/resources",
                "openapi": "https://www.theqrl.org/openapi.json",
                "documentation": "https://www.theqrl.org/developers/"
              }
            }
          }
        }
      },
      "DeveloperResourcesResponse": {
        "description": "Official QRL developer-resource catalog",
        "headers": {
          "Link": {
            "description": "RFC 8631 links to the OpenAPI service description and human-readable service documentation.",
            "schema": {
              "type": "string"
            }
          },
          "X-API-Version": {
            "description": "Version of this website API.",
            "schema": {
              "type": "string",
              "const": "1.0.0"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/DeveloperResources"
            }
          }
        }
      },
      "HeadResponse": {
        "description": "The resource exists; the response has the same headers as GET and no body.",
        "headers": {
          "Link": {
            "description": "RFC 8631 links to service description and documentation.",
            "schema": {
              "type": "string"
            }
          },
          "X-API-Version": {
            "description": "Version of this website API.",
            "schema": {
              "type": "string",
              "const": "1.0.0"
            }
          }
        }
      },
      "OptionsResponse": {
        "description": "Supported methods and cross-origin request metadata; no response body.",
        "headers": {
          "Allow": {
            "description": "Methods supported by the endpoint.",
            "schema": {
              "type": "string",
              "const": "GET, HEAD, OPTIONS"
            }
          },
          "Access-Control-Allow-Methods": {
            "description": "Methods allowed for cross-origin requests.",
            "schema": {
              "type": "string",
              "const": "GET, HEAD, OPTIONS"
            }
          }
        }
      },
      "ErrorResponse": {
        "description": "A structured error with a stable code and recovery guidance.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": {
                "code": "NOT_FOUND",
                "message": "No QRL website API endpoint exists at /api/example.",
                "resolution": "Use a path documented in the QRL OpenAPI specification.",
                "documentation_url": "https://www.theqrl.org/developers/",
                "request_path": "/api/example"
              }
            }
          }
        }
      }
    },
    "schemas": {
      "ApiIndex": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "description",
          "api_version",
          "links"
        ],
        "properties": {
          "name": {
            "type": "string",
            "const": "QRL Developer Resources API"
          },
          "description": {
            "type": "string"
          },
          "api_version": {
            "type": "string",
            "const": "1.0.0"
          },
          "links": {
            "$ref": "#/components/schemas/ApiIndexLinks"
          }
        }
      },
      "ApiIndexLinks": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "self",
          "developer_resources",
          "openapi",
          "documentation"
        ],
        "properties": {
          "self": {
            "type": "string",
            "format": "uri"
          },
          "developer_resources": {
            "type": "string",
            "format": "uri"
          },
          "openapi": {
            "type": "string",
            "format": "uri"
          },
          "documentation": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "DeveloperResources": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "api_version",
          "data",
          "links"
        ],
        "properties": {
          "api_version": {
            "type": "string",
            "const": "1.0.0"
          },
          "data": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/DeveloperResource"
            }
          },
          "links": {
            "$ref": "#/components/schemas/ResourceLinks"
          }
        }
      },
      "DeveloperResource": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "description",
          "category",
          "network",
          "url"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string",
            "minLength": 1
          },
          "category": {
            "type": "string",
            "enum": [
              "documentation",
              "api_documentation",
              "source_code",
              "standards"
            ]
          },
          "network": {
            "type": "string",
            "minLength": 1
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "ResourceLinks": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "self",
          "api_root",
          "openapi",
          "documentation"
        ],
        "properties": {
          "self": {
            "type": "string",
            "format": "uri"
          },
          "api_root": {
            "type": "string",
            "format": "uri"
          },
          "openapi": {
            "type": "string",
            "format": "uri"
          },
          "documentation": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "Error": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "message",
          "resolution",
          "documentation_url",
          "request_path"
        ],
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "NOT_FOUND",
              "METHOD_NOT_ALLOWED"
            ]
          },
          "message": {
            "type": "string",
            "minLength": 1
          },
          "resolution": {
            "type": "string",
            "minLength": 1
          },
          "documentation_url": {
            "type": "string",
            "format": "uri"
          },
          "request_path": {
            "type": "string",
            "pattern": "^/api(?:/.*)?$"
          }
        }
      }
    }
  },
  "externalDocs": {
    "description": "QRL developer resources",
    "url": "https://www.theqrl.org/developers/"
  }
}
