Skip to content

fix(prepare_create_asset): surface relation type publicId, roles and complex relation legs#100

Open
topizio wants to merge 2 commits into
mainfrom
fix/prepare-create-asset-relation-schema
Open

fix(prepare_create_asset): surface relation type publicId, roles and complex relation legs#100
topizio wants to merge 2 commits into
mainfrom
fix/prepare-create-asset-relation-schema

Conversation

@topizio

@topizio topizio commented Jul 15, 2026

Copy link
Copy Markdown

Description of your changes

prepare_create_asset previously returned relation slots with only a UUID — no publicId, and empty role/coRole/direction/targetType. The empty role was a broken contract: the reducer read those fields from the assignment's characteristicTypes array, which the DGC API never populates for them.

This PR is split into two independent, separately-droppable commits:

1. fix: simple relation types (d2bc1a4)

  • publicId is threaded through from the scoped assignment (mirroring the attribute path).
  • role/coRole are hydrated from /rest/2.0/relationTypes/{id} — they live on the relation type resource, not the assignment.
  • direction and the other-leg type restriction are read from the assignment reference (relationTypeDirection / relationTypeRestriction), replacing the speculative characteristicTypes metadata struct.
  • Docs: cross-reference get_asset_detailsprepare_create_asset for type ids/publicIds; concept→tool id-source table; corrected direction values (TO_TARGET/TO_SOURCE).

2. feat: complex relation types (5e5d2e1) — optional; safe to drop if out of scope

  • Complex relation types (FieldMapping_C, ForeignKeyMapping) 404 on /relationTypes/{id} and have no single role — they have two or more legs, each with its own role and asset type.
  • Relation slots now carry a kind discriminator; complex ones hydrate from /rest/2.0/complexRelationTypes/{id} and expose a legs[] list. This removes the 404 that previously leaked into the response message.

Impact Analysis

Scope is limited to the prepare_create_asset tool and its client. RelationSchemaEntry gains kind and legs (both omitempty, additive); existing fields are unchanged. Adds one /relationTypes/{id} (or /complexRelationTypes/{id}) call per relation slot during hydration, tolerant of per-item errors.

Verified end-to-end against a live Collibra instance (Column / Supply Chain, 19 relation slots): all simple relations return role/coRole/direction; FieldMapping_C and ForeignKeyMapping return their three legs; the response message no longer carries a hydration 404. Full test suite: 291 passed / 37 packages.

🤖 Generated with Claude Code

topizio and others added 2 commits July 15, 2026 15:10
…le and direction

Relation slots previously exposed only a UUID. publicId is now threaded
through from the scoped assignment (mirroring the attribute path), and
role/coRole are hydrated from /relationTypes/{id} since they are not part
of the assignment payload. direction and the other-leg type restriction
are read from the assignment reference (relationTypeDirection /
relationTypeRestriction), replacing a speculative characteristicTypes
metadata struct the API never populated.

Also cross-references get_asset_details -> prepare_create_asset for
type ids/publicIds, adds a concept->tool id-source table, and documents
that complex relation types have no role via /relationTypes/{id}.

Verified end-to-end against a live Collibra instance (Column / Supply
Chain): ColumnIsPartOfTable returns role "is part of", coRole "contains",
direction "TO_TARGET".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Complex relation types (e.g. FieldMapping_C, ForeignKeyMapping) are not
resolvable via /relationTypes/{id} — that endpoint 404s for them. They
also have no single role: a complex relation has two or more legs, each
with its own role, coRole and asset type.

Relation slots now carry a Kind discriminator. Simple relations hydrate
from /relationTypes/{id} as before; complex ones hydrate from
/complexRelationTypes/{id} and expose a legs[] list. This removes the
previous 404 that leaked into the response message.

Verified end-to-end against a live Collibra instance: FieldMapping_C and
ForeignKeyMapping return their three legs with roles and asset types.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@topizio
topizio requested a review from a team as a code owner July 15, 2026 14:06
@svc-snyk-github-jira

svc-snyk-github-jira commented Jul 15, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants