Skip to content

Get an external dependency snapshot

GET
/dependency-snapshots
curl --request GET \
--url 'https://api.modeldesk.io/dependency-snapshots?location=https%3A%2F%2Fexample.com&focus=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0' \
--header 'Authorization: Bearer <token>'

Get the cached snapshot of an external, URI-addressed dependency. A location can hold one cached snapshot per vocabulary it has been parsed into, so focus is required: the caller is authorized for the focus model, the location must be in that model’s own dependency set, and the row served is the one the focus model’s resolved metamodel can read, the same selection the full model read makes. With ref, both the dependency set and the resolved metamodel are the ones the focus model holds at that ref. A location the focus holds no dependency of, because only one of its dependencies imports it, is served through the dependency edge that dependency’s snapshot declares, the one metamodel names, and the row is the one the full model read attaches for that edge. A location or focus that resolves to nothing is answered 404. The ETag is the cached row’s id rather than a content hash, and If-None-Match is answered 304 when it matches the selected row.

location
required
string format: uri

The dependency’s location, as recorded on the dependency element.

focus
required
string format: uuid

The model whose dependency set names the location and whose resolved metamodel selects the snapshot to serve.

ref
string format: uuid

A ref of the focus model, a model_branch document id, whose dependency set must name the location and whose pins resolve the metamodel that selects the snapshot. Read as GET /models/{focus}?ref= reads it: a draft is its owner’s alone. When omitted, the focus model’s main branch is read.

metamodel
string format: uuid

For a location the focus holds no dependency of: the metamodel the importing dependency edge’s document was read through, the one the edge declares or, when it declares none, the one its importer declares, as the transitive copy of the edge would state it. Omitted, an edge read through neither is asked for. Ignored when the focus holds a dependency of the location itself, though a value that is not a UUID is still a 400.

OK

Media typeapplication/json

The self-contained state of a dependency at a pin: every element of the pinned model, keyed by element id, with no metamodel, index or nested dependency content.

object
commitId

The pinned commit. Absent for an external dependency, which has no commit.

string format: uuid
rootElement
required
object
elementId
required
string format: uuid
revisionId

The root element’s revision, when the snapshot records one.

string format: uuid
elements
required
object
key
additional properties
object
id
required
string format: uuid
type
required
string
external
boolean
attributes
object
key
additional properties
array
relations
object
key
additional properties
object
key
additional properties
Array<object>
object
id
required
string format: uuid
owned
required
boolean
modelId

Owning model of the referenced element when it differs from the containing model (cross-model reference, e.g. a lineage base element). Omitted for same-model references.

string format: uuid
extensionLayer

The values the element holds that its type declares no property for; absent when none.

Array

A value an element holds under no binding its type declares, kept so a round trip loses nothing.

One of: discriminator: kind
attribute
object
kind
required
string
Allowed value: attribute
key
string
lexicalValue
string
typeIdentifier
string
qualifiers
object
key
additional properties
string
lineage

Where an element was derived from: the source and rules models, and per property the source values it read.

object
sourceModels
Array<object>
object
modelId
string format: uuid
commitId
string format: uuid
rulesModels
Array<object>
object
modelId
string format: uuid
commitId
string format: uuid
generatedBy
object
id
required
string format: uuid
owned
required
boolean
modelId

Owning model of the referenced element when it differs from the containing model (cross-model reference, e.g. a lineage base element). Omitted for same-model references.

string format: uuid
properties
Array<object>
object
propertyName
string
propertyType
string
Allowed values: ATTRIBUTE RELATION
sources
Array<object>
object
sourceModelId
string format: uuid
sourceElementId
string format: uuid
sourceProperty
string
propertyType
string
Allowed values: ATTRIBUTE RELATION
role
string
Allowed values: PRIMARY VALUE_READ
usedRule
object
id
required
string format: uuid
owned
required
boolean
modelId

Owning model of the referenced element when it differs from the containing model (cross-model reference, e.g. a lineage base element). Omitted for same-model references.

string format: uuid

Example

{
"elements": {
"additionalProperty": {
"extensionLayer": [
{
"kind": "attribute"
}
],
"lineage": {
"properties": [
{
"propertyType": "ATTRIBUTE",
"sources": [
{
"propertyType": "ATTRIBUTE",
"role": "PRIMARY"
}
]
}
]
}
}
}
}

Not modified

Bad request

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"
}
]
}

Not found, answered with the same plain problem, in the same words, for a focus the caller may not read, a location neither the focus nor any of its dependency snapshots declares (through metamodel, when the focus holds no dependency of it), and a location with no snapshot its metamodel can read. The one exception is ref: on a focus the caller may read, a ref that is not there for them (an unknown id or another user’s draft alike) is answered as RefNotFoundProblem. That reveals only that the caller may read the focus, which GET /models/{modelId} already tells them, and nothing about the location; a focus they may not read keeps the plain problem whatever ref was named.

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"
}

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"
}
]
}