{
 "openapi": "3.0.3",
 "info": {
  "title": "The Living Bread Open Data Commons API",
  "version": "1.0.0",
  "description": "A read only, keyless JSON API over the small, public, licence clear datasets of The Living Bread, plus the location of the static release files. Our own writing is CC BY 4.0 (credit The Living Bread, https://living-bread.org). The church directories are ODbL 1.0 and are downloads only. No member data, no Scripture text. Responses are static for a release, cached, and carry an ETag. Requests are rate limited per IP by the Worker (300 a minute).",
  "license": {
   "name": "CC BY 4.0",
   "url": "https://creativecommons.org/licenses/by/4.0/"
  },
  "contact": {
   "name": "The Living Bread",
   "url": "https://living-bread.org/open-data"
  }
 },
 "servers": [
  {
   "url": "https://mcp.living-bread.org/commons/v1",
   "description": "The read only API (Cloudflare Worker, static data, no database)"
  }
 ],
 "paths": {
  "/": {
   "get": {
    "summary": "The catalogue: release, identifier, every dataset with licence, count, as-of date, API path and download links",
    "responses": {
     "200": {
      "description": "Catalogue",
      "headers": {
       "Cache-Control": {
        "schema": {
         "type": "string"
        },
        "description": "public, max-age=3600, s-maxage=86400, stale-while-revalidate=86400"
       },
       "ETag": {
        "schema": {
         "type": "string"
        },
        "description": "Changes only when the release changes. Send it back as If-None-Match to receive 304."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Catalogue"
        }
       }
      }
     },
     "304": {
      "description": "Not modified"
     }
    }
   }
  },
  "/datasets": {
   "get": {
    "summary": "The list of datasets (same records as the catalogue)",
    "responses": {
     "200": {
      "description": "Datasets",
      "headers": {
       "Cache-Control": {
        "schema": {
         "type": "string"
        },
        "description": "public, max-age=3600, s-maxage=86400, stale-while-revalidate=86400"
       },
       "ETag": {
        "schema": {
         "type": "string"
        },
        "description": "Changes only when the release changes. Send it back as If-None-Match to receive 304."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/answers": {
   "get": {
    "summary": "Plain answers about Christian community, prayer and The Living Bread",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "offset",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 0,
       "default": 0
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A page of records",
      "headers": {
       "Cache-Control": {
        "schema": {
         "type": "string"
        },
        "description": "public, max-age=3600, s-maxage=86400, stale-while-revalidate=86400"
       },
       "ETag": {
        "schema": {
         "type": "string"
        },
        "description": "Changes only when the release changes. Send it back as If-None-Match to receive 304."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Page"
        }
       }
      }
     },
     "304": {
      "description": "Not modified"
     },
     "429": {
      "description": "Too many requests; wait a minute"
     }
    }
   }
  },
  "/answers/{slug}": {
   "get": {
    "summary": "One answer by slug",
    "parameters": [
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The record",
      "headers": {
       "Cache-Control": {
        "schema": {
         "type": "string"
        },
        "description": "public, max-age=3600, s-maxage=86400, stale-while-revalidate=86400"
       },
       "ETag": {
        "schema": {
         "type": "string"
        },
        "description": "Changes only when the release changes. Send it back as If-None-Match to receive 304."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "304": {
      "description": "Not modified"
     },
     "404": {
      "description": "No such record"
     }
    }
   }
  },
  "/plans": {
   "get": {
    "summary": "Reading plans by life need (days included in the single plan record)",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "offset",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 0,
       "default": 0
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A page of records",
      "headers": {
       "Cache-Control": {
        "schema": {
         "type": "string"
        },
        "description": "public, max-age=3600, s-maxage=86400, stale-while-revalidate=86400"
       },
       "ETag": {
        "schema": {
         "type": "string"
        },
        "description": "Changes only when the release changes. Send it back as If-None-Match to receive 304."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Page"
        }
       }
      }
     },
     "304": {
      "description": "Not modified"
     },
     "429": {
      "description": "Too many requests; wait a minute"
     }
    }
   }
  },
  "/plans/{id}": {
   "get": {
    "summary": "One reading plan with every day (reference, reflection, step; no Scripture text)",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The record",
      "headers": {
       "Cache-Control": {
        "schema": {
         "type": "string"
        },
        "description": "public, max-age=3600, s-maxage=86400, stale-while-revalidate=86400"
       },
       "ETag": {
        "schema": {
         "type": "string"
        },
        "description": "Changes only when the release changes. Send it back as If-None-Match to receive 304."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "304": {
      "description": "Not modified"
     },
     "404": {
      "description": "No such record"
     }
    }
   }
  },
  "/entities": {
   "get": {
    "summary": "Faith entities and their relationships",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "offset",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 0,
       "default": 0
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A page of records",
      "headers": {
       "Cache-Control": {
        "schema": {
         "type": "string"
        },
        "description": "public, max-age=3600, s-maxage=86400, stale-while-revalidate=86400"
       },
       "ETag": {
        "schema": {
         "type": "string"
        },
        "description": "Changes only when the release changes. Send it back as If-None-Match to receive 304."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Page"
        }
       }
      }
     },
     "304": {
      "description": "Not modified"
     },
     "429": {
      "description": "Too many requests; wait a minute"
     }
    }
   }
  },
  "/entities/{id}": {
   "get": {
    "summary": "One entity with aliases and typed relationships",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The record",
      "headers": {
       "Cache-Control": {
        "schema": {
         "type": "string"
        },
        "description": "public, max-age=3600, s-maxage=86400, stale-while-revalidate=86400"
       },
       "ETag": {
        "schema": {
         "type": "string"
        },
        "description": "Changes only when the release changes. Send it back as If-None-Match to receive 304."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "304": {
      "description": "Not modified"
     },
     "404": {
      "description": "No such record"
     }
    }
   }
  },
  "/questions": {
   "get": {
    "summary": "Questions people ask and the page that answers each",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "offset",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 0,
       "default": 0
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A page of records",
      "headers": {
       "Cache-Control": {
        "schema": {
         "type": "string"
        },
        "description": "public, max-age=3600, s-maxage=86400, stale-while-revalidate=86400"
       },
       "ETag": {
        "schema": {
         "type": "string"
        },
        "description": "Changes only when the release changes. Send it back as If-None-Match to receive 304."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Page"
        }
       }
      }
     },
     "304": {
      "description": "Not modified"
     },
     "429": {
      "description": "Too many requests; wait a minute"
     }
    }
   }
  },
  "/openapi.json": {
   "get": {
    "summary": "This description",
    "responses": {
     "200": {
      "description": "OpenAPI 3 document"
     }
    }
   }
  }
 },
 "x-static-downloads": {
  "description": "Large files are static downloads on living-bread.org, not API calls. Verify with SHA256SUMS.",
  "base": "https://living-bread.org/open-data/releases/{version}/",
  "manifest": "https://living-bread.org/open-data/latest.json",
  "files": [
   "datapackage.json",
   "SHA256SUMS",
   "README.md",
   "CHANGELOG.md",
   "LICENSES.md",
   "christ-graph.json",
   "christ-graph-nodes.csv",
   "christ-graph-edges.csv",
   "church-directory-world.json",
   "church-directory-world.csv",
   "church-directory-us.csv",
   "answers.json",
   "answers.csv",
   "reading-plans.json",
   "reading-plan-days.csv",
   "entities.json",
   "entities.csv",
   "questions.json",
   "questions.csv"
  ]
 },
 "components": {
  "schemas": {
   "Page": {
    "type": "object",
    "properties": {
     "version": {
      "type": "string"
     },
     "license": {
      "type": "string"
     },
     "attribution": {
      "type": "string"
     },
     "total": {
      "type": "integer"
     },
     "limit": {
      "type": "integer"
     },
     "offset": {
      "type": "integer"
     },
     "next": {
      "type": [
       "string",
       "null"
      ]
     },
     "records": {
      "type": "array",
      "items": {
       "type": "object"
      }
     }
    }
   },
   "Catalogue": {
    "type": "object",
    "properties": {
     "version": {
      "type": "string"
     },
     "released": {
      "type": "string",
      "format": "date"
     },
     "identifier": {
      "type": "string"
     },
     "page": {
      "type": "string"
     },
     "attribution": {
      "type": "string"
     },
     "datasets": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "id": {
         "type": "string"
        },
        "title": {
         "type": "string"
        },
        "license": {
         "type": "string"
        },
        "license_url": {
         "type": "string"
        },
        "count": {
         "type": "integer"
        },
        "as_of": {
         "type": "string"
        },
        "api": {
         "type": [
          "string",
          "null"
         ]
        },
        "downloads": {
         "type": "array",
         "items": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   }
  }
 }
}