OpenFolia

Compare two versions of a manual

GET
/manuals/{id}/compare

The manual at both versions and the members of its manifest that differ (meta.change, meta.fields), so the review screen’s manual diff renders it. Each side is read as reading its commit needs: a released commit (main’s head, a release tag) with content.read, any other, also an older commit of main, with content.read.draft, else 404 as for a ref that does not exist. Each side shows the manual only as the reader would see it on the other too (its audience, and only the modules a manifest may name to them on both); a side where it is not there is added or removed; 404 when neither has it.

Authorization

bearer
headerAuthorizationBearer <JWT>

A service account's token (ccms_sat_…, issued by POST /service-accounts/{id}/tokens), or, for local use and demo mode, the server's shared CCMS_API_TOKEN.

Path Parameters

id*string
Match^[a-z0-9]+(?:-[a-z0-9]+)*$
Lengthlength <= 100

Query Parameters

base*string

The older version: a commit ID or a tag.

Length1 <= length <= 256
head*string

The newer version: a commit ID or a tag.

Length1 <= length <= 256

Response Body

application/vnd.api+json
  1. response
data*

id is <manualId>/<base commit>..<head commit>. Derived from Git, never stored.

Example Request
curl -X GET 'http://localhost:3000/manuals/operating/compare?base=string&head=string'
Example Response
{  "data": {    "type": "ManualComparison",    "id": "string",    "attributes": {      "base": {        "schemaVersion": 1,        "kind": "derived",        "title": "string",        "audience": "string",        "deprecated": {          "reason": "string",          "replacedBy": "string"        },        "variants": [          {            "property1": "string",            "property2": "string"          }        ],        "textAttributes": {},        "coverImage": {          "default": {            "asset": "string",            "alt": "string"          },          "variants": []        },        "rule": {          "source": "string",          "moduleTypes": [            "string"          ],          "exclude": [],          "front": [],          "back": [],          "notices": {            "groupBy": "module",            "levels": [              "danger"            ]          }        },        "entries": [          {            "module": "string",            "when": {              "op": "all",              "of": [                null,                null              ]            }          }        ]      },      "head": {        "schemaVersion": 1,        "kind": "derived",        "title": "string",        "audience": "string",        "deprecated": {          "reason": "string",          "replacedBy": "string"        },        "variants": [          {            "property1": "string",            "property2": "string"          }        ],        "textAttributes": {},        "coverImage": {          "default": {            "asset": "string",            "alt": "string"          },          "variants": []        },        "rule": {          "source": "string",          "moduleTypes": [            "string"          ],          "exclude": [],          "front": [],          "back": [],          "notices": {            "groupBy": "module",            "levels": [              "danger"            ]          }        },        "entries": [          {            "module": "string",            "when": {              "op": "all",              "of": [                null,                null              ]            }          }        ]      }    },    "meta": {      "base": "string",      "head": "string",      "change": "added",      "fields": [        "string"      ],      "unreadable": true    }  }}