Alpha: Document API is currently alpha and subject to breaking changes.
Summary
Compare the current document (base) against a previously captured target snapshot. Returns a versioned diff payload describing the changes from base to target.- Operation ID:
diff.compare - API member path:
editor.doc.diff.compare(...) - Mutates document:
no - Idempotency:
idempotent - Supports tracked mode:
no - Supports dry run:
no - Deterministic target resolution:
yes
Expected result
Returns a DiffPayload with a summary and opaque payload.Input fields
| Field | Type | Required | Description |
|---|---|---|---|
targetSnapshot | object(version=“sd-diff-snapshot/v1”) | yes | |
targetSnapshot.coverage | object | yes | |
targetSnapshot.coverage.body | true | yes | Constant: true |
targetSnapshot.coverage.comments | boolean | yes | |
targetSnapshot.coverage.headerFooters | false | yes | Constant: false |
targetSnapshot.coverage.numbering | boolean | yes | |
targetSnapshot.coverage.styles | boolean | yes | |
targetSnapshot.engine | enum | yes | "super-editor" |
targetSnapshot.fingerprint | string | yes | |
targetSnapshot.payload | object | yes | |
targetSnapshot.version | "sd-diff-snapshot/v1" | yes | Constant: "sd-diff-snapshot/v1" |
Example request
Output fields
| Field | Type | Required | Description |
|---|---|---|---|
baseFingerprint | string | yes | |
coverage | object | yes | |
coverage.body | true | yes | Constant: true |
coverage.comments | boolean | yes | |
coverage.headerFooters | false | yes | Constant: false |
coverage.numbering | boolean | yes | |
coverage.styles | boolean | yes | |
engine | enum | yes | "super-editor" |
payload | object | yes | |
summary | object | yes | |
summary.body | object | yes | |
summary.body.hasChanges | boolean | yes | |
summary.changedComponents | enum[] | yes | |
summary.comments | object | yes | |
summary.comments.hasChanges | boolean | yes | |
summary.hasChanges | boolean | yes | |
summary.numbering | object | yes | |
summary.numbering.hasChanges | boolean | yes | |
summary.styles | object | yes | |
summary.styles.hasChanges | boolean | yes | |
targetFingerprint | string | yes | |
version | "sd-diff-payload/v1" | yes | Constant: "sd-diff-payload/v1" |
Example response
Pre-apply throws
INVALID_INPUTCAPABILITY_UNSUPPORTED
Non-applied failure codes
- None
Raw schemas
Raw input schema
Raw input schema
Raw output schema
Raw output schema

