Skip to content

Compare dataset branches

GET
/datasets/{datasetId}/branches/{branchId}/diff
curl --request GET \
--url 'https://api.modeldesk.io/datasets/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/branches/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/diff?offset=0&limit=100' \
--header 'Authorization: Bearer <token>'

What a branch changed since it diverged from base, main when omitted: the ids of the rows it added, changed and removed between the two branches’ merge base and its head, and one page of those rows, each as it stood at the merge base and at the head with the columns that differ. commitId is the branch’s head and parentCommitId the merge base. A branch compared with itself answers no rows. Open to every reader of the dataset.

datasetId
required
string format: uuid
branchId
required
string format: uuid
base
string format: uuid

The branch to compare against. Without it, main.

offset
integer
0

How many touched rows to skip before the page.

limit
integer
default: 100 >= 1 <= 500

How many touched rows the page holds.

OK

Media typeapplication/json

What one commit changed against its parent, by row: the ids of every row it touched, and one page of those rows with both sides. The pages run over every touched row in row id order. A row that changed twice and came back to where it started shows in none of the three lists.

object
commitId
required
string format: uuid
parentCommitId

Absent for the first commit of a dataset.

string format: uuid
added
Array<string>
changed
Array<string>
removed
Array<string>
totals
DatasetDiffTotals

How many rows the diff added, changed and removed, over all its pages.

object
added
integer
changed
integer
removed
integer
offset

Where the page starts among all touched rows.

integer
rows
Array<object>

One row on both sides of a diff, whole: a reader names it by its naming column and shows the reason it gives beside a changed column, neither of which a change need touch.

object
rowId
required
string format: uuid
diffType
required
string
Allowed values: ADDED MODIFIED REMOVED
before

The row before; absent for a row the commit added.

object
rowId
required

The row’s stable identity, minted once and surviving every edit.

string format: uuid
values

Value-property source element id to the terms the row holds for it.

object
key
additional properties
Array
refs

Reference-property source element id to the rows it points at.

object
key
additional properties
Array<object>

A pointer to a row, in this dataset or in one this dataset declares a dependency on.

object
datasetId
required
string format: uuid
rowId
required
string format: uuid
platformRefs

Reference-property source element id to the models, model elements and datasets it points at, for a property whose target type is represented by things the platform holds. Such a property holds these and never row references. Absent when the row holds none. A write that leaves platformRefs out keeps the ones the row holds, as a client that knows nothing of them writes every row; one that sends {} clears them. The two fields are told apart each on its own.

object
key
additional properties
Array<object>

A pointer to a thing the platform holds: a model, an element of a model, or a dataset. A model or element is read at the state the dataset pins the model at; a dataset as it stands.

object
kind
required
string
Allowed values: MODEL ELEMENT DATASET
resourceId
required

The model, for a model or an element; the dataset, for a dataset.

string format: uuid
elementId

The element of the model; present exactly for an ELEMENT.

string format: uuid
parts

Containment-property source element id to the parts the row holds inside itself, for a property whose target type has no identity of its own (a contact point, a period). Such a property holds parts and never row references. Absent when the row holds none. A write that leaves parts out keeps the parts the row holds, as a client that knows nothing of parts writes every row; one that sends it, empty included, leaves the row holding what it sent.

object
key
additional properties
Array<object>

One part a row holds inside itself: an occurrence of a containment property whose target type has no identity of its own. Its maps are keyed as a row’s are, and it holds parts of its own to whatever depth the model nests them.

object
partId

The part’s identity inside its row, so a change to one part is told from a change to another. Send it back unchanged on every write of the row; a part written without one gets a new one, and two parts of one row under one id are a 400.

string format: uuid
values

Value-property source element id to the terms the part holds for it.

object
key
additional properties
Array
refs

Reference-property source element id to the rows it points at.

object
key
additional properties
Array<object>

A pointer to a row, in this dataset or in one this dataset declares a dependency on.

object
datasetId
required
string format: uuid
rowId
required
string format: uuid
platformRefs

Reference-property source element id to the models, model elements and datasets the part points at, for a property whose target type is represented by things the platform holds. A part is written whole, so a part sent without them holds none. Absent when the part holds none.

object
key
additional properties
Array<object>

A pointer to a thing the platform holds: a model, an element of a model, or a dataset. A model or element is read at the state the dataset pins the model at; a dataset as it stands.

object
kind
required
string
Allowed values: MODEL ELEMENT DATASET
resourceId
required

The model, for a model or an element; the dataset, for a dataset.

string format: uuid
elementId

The element of the model; present exactly for an ELEMENT.

string format: uuid
parts

Containment-property source element id to the parts this part holds.

object
key
additional properties
Array<object> recursive
after

The row after; absent for a row the commit removed.

object
rowId
required

The row’s stable identity, minted once and surviving every edit.

string format: uuid
values

Value-property source element id to the terms the row holds for it.

object
key
additional properties
Array
refs

Reference-property source element id to the rows it points at.

object
key
additional properties
Array<object>

A pointer to a row, in this dataset or in one this dataset declares a dependency on.

object
datasetId
required
string format: uuid
rowId
required
string format: uuid
platformRefs

Reference-property source element id to the models, model elements and datasets it points at, for a property whose target type is represented by things the platform holds. Such a property holds these and never row references. Absent when the row holds none. A write that leaves platformRefs out keeps the ones the row holds, as a client that knows nothing of them writes every row; one that sends {} clears them. The two fields are told apart each on its own.

object
key
additional properties
Array<object>

A pointer to a thing the platform holds: a model, an element of a model, or a dataset. A model or element is read at the state the dataset pins the model at; a dataset as it stands.

object
kind
required
string
Allowed values: MODEL ELEMENT DATASET
resourceId
required

The model, for a model or an element; the dataset, for a dataset.

string format: uuid
elementId

The element of the model; present exactly for an ELEMENT.

string format: uuid
parts

Containment-property source element id to the parts the row holds inside itself, for a property whose target type has no identity of its own (a contact point, a period). Such a property holds parts and never row references. Absent when the row holds none. A write that leaves parts out keeps the parts the row holds, as a client that knows nothing of parts writes every row; one that sends it, empty included, leaves the row holding what it sent.

object
key
additional properties
Array<object>

One part a row holds inside itself: an occurrence of a containment property whose target type has no identity of its own. Its maps are keyed as a row’s are, and it holds parts of its own to whatever depth the model nests them.

object
partId

The part’s identity inside its row, so a change to one part is told from a change to another. Send it back unchanged on every write of the row; a part written without one gets a new one, and two parts of one row under one id are a 400.

string format: uuid
values

Value-property source element id to the terms the part holds for it.

object
key
additional properties
Array
refs

Reference-property source element id to the rows it points at.

object
key
additional properties
Array<object>

A pointer to a row, in this dataset or in one this dataset declares a dependency on.

object
datasetId
required
string format: uuid
rowId
required
string format: uuid
platformRefs

Reference-property source element id to the models, model elements and datasets the part points at, for a property whose target type is represented by things the platform holds. A part is written whole, so a part sent without them holds none. Absent when the part holds none.

object
key
additional properties
Array<object>

A pointer to a thing the platform holds: a model, an element of a model, or a dataset. A model or element is read at the state the dataset pins the model at; a dataset as it stands.

object
kind
required
string
Allowed values: MODEL ELEMENT DATASET
resourceId
required

The model, for a model or an element; the dataset, for a dataset.

string format: uuid
elementId

The element of the model; present exactly for an ELEMENT.

string format: uuid
parts

Containment-property source element id to the parts this part holds.

object
key
additional properties
Array<object> recursive
changedColumns

The value, reference and part columns, by source element id, whose content differs, a part column where any of its parts differs at any depth; every column the row holds for an added or removed row. The parts of both sides are whole on before and after, to be paired by partId.

Array<string>
referenced

The rows of this dataset the page’s references point at, by row id, as the commit holds them, else as its parent did, so a reference is named without a second read.

object
key
additional properties

One entry of a dataset. Both maps are keyed by the data schema’s source element ids, never by a name: the element id is what survives a rename, and it is what lets a model mapping induce a dataset migration later.

object
rowId
required

The row’s stable identity, minted once and surviving every edit.

string format: uuid
values

Value-property source element id to the terms the row holds for it.

object
key
additional properties
Array
refs

Reference-property source element id to the rows it points at.

object
key
additional properties
Array<object>

A pointer to a row, in this dataset or in one this dataset declares a dependency on.

object
datasetId
required
string format: uuid
rowId
required
string format: uuid
platformRefs

Reference-property source element id to the models, model elements and datasets it points at, for a property whose target type is represented by things the platform holds. Such a property holds these and never row references. Absent when the row holds none. A write that leaves platformRefs out keeps the ones the row holds, as a client that knows nothing of them writes every row; one that sends {} clears them. The two fields are told apart each on its own.

object
key
additional properties
Array<object>

A pointer to a thing the platform holds: a model, an element of a model, or a dataset. A model or element is read at the state the dataset pins the model at; a dataset as it stands.

object
kind
required
string
Allowed values: MODEL ELEMENT DATASET
resourceId
required

The model, for a model or an element; the dataset, for a dataset.

string format: uuid
elementId

The element of the model; present exactly for an ELEMENT.

string format: uuid
parts

Containment-property source element id to the parts the row holds inside itself, for a property whose target type has no identity of its own (a contact point, a period). Such a property holds parts and never row references. Absent when the row holds none. A write that leaves parts out keeps the parts the row holds, as a client that knows nothing of parts writes every row; one that sends it, empty included, leaves the row holding what it sent.

object
key
additional properties
Array<object>

One part a row holds inside itself: an occurrence of a containment property whose target type has no identity of its own. Its maps are keyed as a row’s are, and it holds parts of its own to whatever depth the model nests them.

object
partId

The part’s identity inside its row, so a change to one part is told from a change to another. Send it back unchanged on every write of the row; a part written without one gets a new one, and two parts of one row under one id are a 400.

string format: uuid
values

Value-property source element id to the terms the part holds for it.

object
key
additional properties
Array
refs

Reference-property source element id to the rows it points at.

object
key
additional properties
Array<object>

A pointer to a row, in this dataset or in one this dataset declares a dependency on.

object
datasetId
required
string format: uuid
rowId
required
string format: uuid
platformRefs

Reference-property source element id to the models, model elements and datasets the part points at, for a property whose target type is represented by things the platform holds. A part is written whole, so a part sent without them holds none. Absent when the part holds none.

object
key
additional properties
Array<object>

A pointer to a thing the platform holds: a model, an element of a model, or a dataset. A model or element is read at the state the dataset pins the model at; a dataset as it stands.

object
kind
required
string
Allowed values: MODEL ELEMENT DATASET
resourceId
required

The model, for a model or an element; the dataset, for a dataset.

string format: uuid
elementId

The element of the model; present exactly for an ELEMENT.

string format: uuid
parts

Containment-property source element id to the parts this part holds.

object
key
additional properties
Array<object> recursive

Example

{
"rows": [
{
"diffType": "ADDED",
"before": {
"platformRefs": {
"additionalProperty": [
{
"kind": "MODEL"
}
]
},
"parts": {
"additionalProperty": [
{
"platformRefs": {
"additionalProperty": [
{
"kind": "MODEL"
}
]
}
}
]
}
},
"after": {
"platformRefs": {
"additionalProperty": [
{
"kind": "MODEL"
}
]
},
"parts": {
"additionalProperty": [
{
"platformRefs": {
"additionalProperty": [
{
"kind": "MODEL"
}
]
}
}
]
}
}
}
],
"referenced": {
"additionalProperty": {
"platformRefs": {
"additionalProperty": [
{
"kind": "MODEL"
}
]
},
"parts": {
"additionalProperty": [
{
"platformRefs": {
"additionalProperty": [
{
"kind": "MODEL"
}
]
}
}
]
}
}
}
}

The dataset does not exist or is not the caller’s to read, answered with the plain problem, or branchId or base names no branch of it, answered as RefNotFoundProblem. A draft is not a branch, so naming one reads as naming nothing.

Media typeapplication/problem+json
Any of:

A Problem answered when a ref the request reads at is not there for the caller, on a resource they may read: a ref id that names nothing, a ref of another resource, and another user’s draft, which reads exactly as a ref that does not exist. The draft routes answer it too when the caller holds no draft.

A 404, as a missing resource is, and told apart from one by its type. A resource the caller cannot read keeps the plain answer it always had, whatever ref was named, so this one never says anything about a resource the caller could not see. To a client it means that the ref it was reading, typically a draft committed or discarded in another session, is gone while the resource stays: it goes back to the branch. The problem names no ref, so the answer for an id that names nothing and for another user’s draft is the same, byte for byte.

object
type
required

Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.

string format: uri
title
required
string
status
required
integer
detail
required
string
instance

The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.

string
violations

Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.

Array<object>
object
property
required
string
message
required
string
type
required

Stable constant a client branches on, which is what tells this 404 from a resource that is missing or not the caller’s to read.

string format: uri
Allowed values: https://modeldesk.io/problems/ref-not-found

Example

{
"type": "https://modeldesk.io/problems/ref-not-found"
}

The two heads have several closest common ancestors, so there is no base to count the branch’s changes against. The problem names them.

Media typeapplication/problem+json

A Problem answered when the two heads have several closest common ancestors, as they do after a criss-cross merge: each branch was merged into the other from a head that did not yet hold the other merge. There is then no single base to compare or merge over, and a merge over any one of them can undo, without a conflict, a deletion the other side made since. Nothing was written. A merge of the same two branches, in either direction, answers the same; one history has to be made to contain the other first, by creating one branch again from the other’s head.

object
type
required

Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.

string format: uri
title
required
string
status
required
integer
detail
required
string
instance

The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.

string
violations

Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.

Array<object>
object
property
required
string
message
required
string
type
required

Stable constant a client branches on, which is what tells this 409 from the others the merge and compare routes answer with.

string format: uri
Allowed values: https://modeldesk.io/problems/ambiguous-merge-base
candidateBaseIds
required

The common ancestors no other common ancestor descends from, in id order: the two pre-merge heads of a criss-cross.

Array<string>
>= 2 items

Example

{
"type": "https://modeldesk.io/problems/ambiguous-merge-base"
}

Error

Media typeapplication/problem+json

An RFC 9457 problem document, always sent as application/problem+json.

object
type

Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.

string format: uri
title
required
string
status
required
integer
detail
required
string
instance

The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.

string
violations

Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.

Array<object>
object
property
required
string
message
required
string

Example generated

{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"violations": [
{
"property": "example",
"message": "example"
}
]
}