{
  "openapi": "3.1.0",
  "info": {
    "title": "Distill.family API",
    "version": "1.0.0",
    "description": "Self-describing JSON API mirroring the Distill.family content tree. Each response includes _links (HATEOAS) and _meta. Content licensed CC BY-SA 4.0.",
    "license": {
      "name": "CC BY-SA 4.0",
      "url": "https://creativecommons.org/licenses/by-sa/4.0/"
    }
  },
  "servers": [
    {
      "url": "https://distill.family/api"
    }
  ],
  "paths": {
    "/": {
      "get": {
        "summary": "API root index"
      }
    },
    "/traditions": {
      "get": {
        "summary": "List all 12 traditions"
      }
    },
    "/traditions/{slug}": {
      "get": {
        "summary": "Single tradition",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/traditions/{slug}/principles": {
      "get": {
        "summary": "N=3 principles for a tradition"
      }
    },
    "/traditions/{slug}/books": {
      "get": {
        "summary": "Source-book collection for a tradition"
      }
    },
    "/traditions/{slug}/books/{id}": {
      "get": {
        "summary": "Single source book (N=1 atomic statements)"
      }
    },
    "/map": {
      "get": {
        "summary": "Map root"
      }
    },
    "/map/convergence": {
      "get": {
        "summary": "26 convergence themes"
      }
    },
    "/map/divergence": {
      "get": {
        "summary": "13 held tensions"
      }
    },
    "/map/jewels": {
      "get": {
        "summary": "~32 preserved jewels"
      }
    },
    "/compass": {
      "get": {
        "summary": "Full union compass"
      }
    },
    "/search": {
      "get": {
        "summary": "Search across content",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lang",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "Envelope": {
        "type": "object",
        "required": [
          "data",
          "_links",
          "_meta"
        ],
        "properties": {
          "data": {},
          "_links": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Link"
            }
          },
          "_meta": {
            "type": "object",
            "required": [
              "lang",
              "license",
              "apiVersion"
            ],
            "properties": {
              "lang": {
                "type": "string"
              },
              "etag": {
                "type": "string"
              },
              "lastModified": {
                "type": "string"
              },
              "license": {
                "type": "string"
              },
              "apiVersion": {
                "type": "string"
              }
            }
          }
        }
      },
      "Link": {
        "type": "object",
        "required": [
          "href"
        ],
        "properties": {
          "href": {
            "type": "string"
          },
          "rel": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        }
      }
    }
  }
}