Skip to content

Comments

Use relationship label if present in custom properties#1044

Open
garrettsutula wants to merge 5 commits intodatacontract:mainfrom
garrettsutula:feat/add-relationship-label-to-mermaid
Open

Use relationship label if present in custom properties#1044
garrettsutula wants to merge 5 commits intodatacontract:mainfrom
garrettsutula:feat/add-relationship-label-to-mermaid

Conversation

@garrettsutula
Copy link

@garrettsutula garrettsutula commented Feb 6, 2026

When relationships[].customProperties['property=label'] is specified, that value will be used as the label in the relationship line drawn between schemas in the exported Mermaid diagram.

This makes it possible for data model authors to further annotate relationships in a way that will generate meaningful diagrams following a UML-like approach for roles described here: https://stackoverflow.com/questions/16732607/role-name-in-association-relationship

Generally, this gives the user a way to override the default display behavior if desired for whatever reason which I don't think merits specification in the standard because it is not really a primary concern of the data contract.

  • Tests pass
  • ruff format
  • README.md updated (if relevant)
  •  CHANGELOG.md entry added

I did modify tests/fixtures/export/datacontract.odcs.yaml and tests/test_export_mermaid.py to add a relationship test assertion and run locally but adding an entity to datacontract.odcs.yaml caused 7 other test cases to fail so I did not include that in the scope of this work.

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