{
  "openapi": "3.1.0",
  "info": {
    "title": "Minespider Glossary Structured JSON API",
    "version": "1.0.0",
    "description": "Read-only structured JSON surfaces for the Minespider source-bound regulatory glossary. The API exposes published terms only and preserves official definitions, source references, source-boundary notes, and Minespider commentary as separate fields."
  },
  "servers": [
    {
      "url": "https://minespider.com/glossary",
      "description": "Production glossary base path"
    }
  ],
  "paths": {
    "/terms.json": {
      "get": {
        "summary": "List public glossary terms",
        "description": "Returns published term summaries for public discovery and agent retrieval.",
        "responses": {
          "200": {
            "description": "Published term summaries",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TermsPayload"
                }
              }
            }
          }
        }
      }
    },
    "/json/terms/{slug}": {
      "get": {
        "summary": "Get one public glossary term",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Full public term detail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TermDetailPayload"
                }
              }
            }
          },
          "404": {
            "description": "No published term exists for this slug"
          }
        }
      }
    },
    "/topics.json": {
      "get": {
        "summary": "List glossary topic guides",
        "responses": {
          "200": {
            "description": "Topic guides with linked terms",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TopicsPayload"
                }
              }
            }
          }
        }
      }
    },
    "/json/topics/{slug}": {
      "get": {
        "summary": "Get one glossary topic guide",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Topic guide detail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TopicDetailPayload"
                }
              }
            }
          },
          "404": {
            "description": "No topic guide exists for this slug"
          }
        }
      }
    },
    "/search.json": {
      "get": {
        "summary": "Search public glossary terms",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ranked public term search results",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchPayload"
                }
              }
            }
          }
        }
      }
    },
    "/regulations.json": {
      "get": {
        "summary": "List regulation and source hubs",
        "responses": {
          "200": {
            "description": "Public regulation/source summaries",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegulationsPayload"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "TermSummary": {
        "type": "object",
        "properties": {
          "term": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "canonical_url": {
            "type": "string",
            "format": "uri"
          },
          "category": {
            "type": "string"
          },
          "short_description": {
            "type": [
              "string",
              "null"
            ]
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "TermsPayload": {
        "type": "object",
        "properties": {
          "version": {
            "type": "integer"
          },
          "count": {
            "type": "integer"
          },
          "terms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TermSummary"
            }
          }
        }
      },
      "TermDetailPayload": {
        "type": "object",
        "properties": {
          "version": {
            "type": "integer"
          },
          "term": {
            "type": "object"
          }
        }
      },
      "TopicsPayload": {
        "type": "object",
        "properties": {
          "version": {
            "type": "integer"
          },
          "count": {
            "type": "integer"
          },
          "topics": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "TopicDetailPayload": {
        "type": "object",
        "properties": {
          "version": {
            "type": "integer"
          },
          "topic": {
            "type": "object"
          }
        }
      },
      "SearchPayload": {
        "type": "object",
        "properties": {
          "version": {
            "type": "integer"
          },
          "query": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TermSummary"
            }
          }
        }
      },
      "RegulationsPayload": {
        "type": "object",
        "properties": {
          "version": {
            "type": "integer"
          },
          "count": {
            "type": "integer"
          },
          "regulations": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      }
    }
  }
}