Skip to content

Relationships with fully qualified notation not displayed in diagram #15

@FriedrichBu

Description

@FriedrichBu

Hey everyone,

I was trying to work with relationships in the datacontract-editor using the fully qualified notation and the shorthand notation as described in the ODCS v3.1.0 here:

schema:
  - id: users_tbl
    name: users
    properties:
      - id: user_id_field
        name: user_id
        relationships:
          # Fully qualified notation (uses id, stable)
          - to: schema/accounts_tbl/properties/owner_id_field

          # OR shorthand notation (uses name, concise)
          - to: accounts.owner_id
            # Note: DO NOT include 'from' field at property level

However, only the shorthand notation worked. Setting type: "foreignKey" had no impact:

Notation Example Working using foreignKey as implicit default Working using foreignKey explicitly
Fully qualified schema/accounts_tbl/properties/owner_id_field No No
shorthand accounts.owner_id Yes Yes

In the Form-View the relationships are correctly displayed, both with and without type: "foreignKey". To me, it seems that the problem is only related to the Diagram-View.

Thanks a lot for your consideration!

I was using datacontract-editor v0.1.2, on Debian-WSL, running as localhost.

Example .yaml:

apiVersion: "v3.1.0"
kind: "DataContract"
name: "Test"
version: "0.0.1"
status: "draft"
schema:
  - name: "address"
    type: "object"
    properties:
      - name: "address_id"
        logicalType: "integer"
        required: true
        primaryKey: true
        primaryKeyPosition: 1
  - name: "company"
    type: "object"
    properties:
      - name: "company_id"
        logicalType: "integer"
        required: true
        primaryKey: true
        primaryKeyPosition: 1
  - name: "client"
    type: "object"
    properties:
      - name: "client_id"
        logicalType: "integer"
        required: true
        primaryKey: true
        primaryKeyPosition: 1
      - name: "company_id"
        logicalType: "integer"
        relationships:
          - type: "foreignKey"
            # Display in Diagram
            to: "company.company_id"
      - name: "address_id"
        logicalType: "integer"
        relationships:
          - type: "foreignKey"
            # Not display in Diagramm
            to: "schema/address/properties/address_id"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions