List embedded mapping rules
const url = 'https://api.modeldesk.io/models/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/origin-mapping/rules';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.modeldesk.io/models/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/origin-mapping/rules \ --header 'Authorization: Bearer <token>'List embedded mapping rules
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Responses
Section titled “Responses”OK
object
A mapping rule, discriminated by its own type.
object
The type of mapping rule (discriminator for polymorphism).
Unique identifier for this rule. Can be client-provided or server-generated.
The rule’s name, where it has one. A stored mapping names its rules; a rule it writes without one is stored under what it produces.
The author’s note on this rule. Stored as the rule element’s description; a blank note is stored as no note, so saving a rule with the text cleared leaves it without one.
Optional reference to an existing element to attach this rule’s output to.
The target element type to create for each matched source element.
The traits each created element carries beside targetType. Where an owned relation holds the element, the relation decides its form: its default trait is added where the element carries no member of the default’s exclusive group, and replaces a member the relation refuses. Absent when the rule names none.
Path expression to select source elements. Mutually exclusive with sourceElementIds.
Explicit source element IDs to map. Mutually exclusive with sourcePath.
Whether the mapped elements are root elements in the target model.
Target owned relation name for nested element mappings. Required when nested under another element mapping.
Reference to the origin model from which source elements are selected.
object
The type of mapping rule (discriminator for polymorphism).
Unique identifier for this rule. Can be client-provided or server-generated.
The rule’s name, where it has one. A stored mapping names its rules; a rule it writes without one is stored under what it produces.
The author’s note on this rule. Stored as the rule element’s description; a blank note is stored as no note, so saving a rule with the text cleared leaves it without one.
Optional reference to an existing element to attach this rule’s output to.
The target attribute name on the parent element’s target type.
Optional path expression to navigate from the parent’s source context.
Value mapping for the right side of the join (typically from target element).
object
Path expression to navigate to target elements.
Attribute options to extract value from (tries each in order until one has a value).
object
The template expression string.
Variable bindings for the template. Keys are variable names referenced in the expression.
object
Default value if no value is found.
Value transformers to apply in order.
object
The type of value mapper (e.g., “lowercase”, “uppercase”, “replace”).
Optional configuration options for the mapper.
object
A rule that writes a relation on the elements its parent rule generates. The target elements come from exactly one source, which is why targetElementMappingId, selectElement and targetQuery are mutually exclusive and at least one of those three, joinOn or sourcePath must be present. A bare sourcePath names no target of its own: each element it reaches is answered by whatever already corresponds to it in the model being produced.
object
The type of mapping rule (discriminator for polymorphism).
Unique identifier for this rule. Can be client-provided or server-generated.
The rule’s name, where it has one. A stored mapping names its rules; a rule it writes without one is stored under what it produces.
The author’s note on this rule. Stored as the rule element’s description; a blank note is stored as no note, so saving a rule with the text cleared leaves it without one.
Optional reference to an existing element to attach this rule’s output to.
The target relation name on the parent element’s target type.
Optional path expression to navigate from the parent’s source context.
Reference to the element mapping that produces the target elements for this relation.
Selects the relation’s target directly, by naming one element of the target model or one of its dependencies.
object
The selected element.
Optional element-filter expression narrowing when the selection applies, evaluated against the source element the relation is written for.
object
Value mapping for the right side of the join (typically from target element).
object
Path expression to navigate to target elements.
Attribute options to extract value from (tries each in order until one has a value).
object
The template expression string.
Variable bindings for the template. Keys are variable names referenced in the expression.
object
Default value if no value is found.
Value transformers to apply in order.
object
The type of value mapper (e.g., “lowercase”, “uppercase”, “replace”).
Optional configuration options for the mapper.
object
Value mapping for the right side of the join (typically from target element).
object
Path expression to navigate to target elements.
Attribute options to extract value from (tries each in order until one has a value).
object
The template expression string.
Variable bindings for the template. Keys are variable names referenced in the expression.
object
Default value if no value is found.
Value transformers to apply in order.
object
The type of value mapper (e.g., “lowercase”, “uppercase”, “replace”).
Optional configuration options for the mapper.
object
A Core DSL match query selecting the relation’s candidates from the run’s target scope, compiled against the target metamodel (match $c isa Class). joinOn picks which candidate a source element relates to. Read before every other target reference; a blank query counts as absent.
Whether a source element whose join matches none of the targetQuery candidates gets an external element generated for it, carrying the joined value as its key. When false, a join matching nothing fails the run. Refused without a targetQuery.
Whether the rule runs only for the source elements the rules before it on the same relation, under the same parent rule, resolved no target for. Several rules on one relation are the routes of one end, tried in their stored order. When false, the rule runs for every source element. A rule carrying it with no rule on its relation before it is refused on save and at run start. A targetQuery rule that a marked rule follows hands a source element it finds nothing for on to that rule instead of refusing it.
Example
{ "rules": [ { "type": "ElementMappingRule", "root": false } ]}Not found
An RFC 9457 problem document, always sent as application/problem+json.
object
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.
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.
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.
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "instance": "example", "violations": [ { "property": "example", "message": "example" } ]}default
Section titled “default”Error
An RFC 9457 problem document, always sent as application/problem+json.
object
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.
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.
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.
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "instance": "example", "violations": [ { "property": "example", "message": "example" } ]}