Skip to content

Prevent referenced entities/attributes when the entities/attributes hasn't been embedded in the data model first #826

@thelmick-unicon

Description

@thelmick-unicon

Is your feature request related to a problem? Please describe.
Currently, it is possible to reference an entity in a data model without that entity being embedded anywhere in the model. This can result in “floating” references that lack clear structural context. These floating references create problems during schema comprehension, validation, and especially during export/import, where referenced entities may not have a stable or discoverable anchor within the model.

This behavior is confusing for users and can lead to brittle schemas that are hard to reason about and unsafe to move between environments.

Describe the solution you'd like
Add mechanisms to prevent referencing an entity unless it has already been embedded at least once within the same data model.

  • Enforce an embedded-first rule
  • Block schema uploads or edits that attempt to add a reference to an entity that is not already embedded in the model
  • Provide clear validation errors explaining why the reference is not allowed and what action is required

Describe alternatives you've considered
None. It was decided that referencing an entity/attribute without first embedding it is not allowed.

Additional context
This issue originated from a broader discussion about embedded vs reference semantics. While the question was initially posed as a discussion topic, consensus emerged that allowing reference-only entities should not be permitted and that explicit mechanisms should be added to enforce this rule.

The embedded-first constraint also supports safer import/export behavior by ensuring all referenced entities have a clear, intentional presence in the model structure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions