Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error for duplicated record keys #25

Merged
merged 6 commits into from
Feb 28, 2022
Merged

Conversation

ypyl
Copy link

@ypyl ypyl commented Feb 26, 2022

Closes #24

@MaybeJustJames MaybeJustJames self-requested a review February 28, 2022 07:58
@MaybeJustJames MaybeJustJames merged commit 2748c3b into MaybeJustJames:master Feb 28, 2022
@MaybeJustJames
Copy link
Owner

Thanks @ypyl for your help with this :)

@ypyl
Copy link
Author

ypyl commented Jul 27, 2022

@MaybeJustJames do you think it will be useful to have a list of duplicated keys in the error message?

I am having an issue showing the user where duplicated keys are as the error looks like this:

Line 54, column 1: Problem: Non-unique keys in record

The yaml file looks like (ring-1 is duplicated). So Line 54, column 1 doesn't make sense to me.

domain:
  name: Name
  description: Description
  actors:
    actor-1:
      name: Actor
      description: Description
      relations:
        - uses - delivery-1
  rings:
    ring-1:
      name: Ring 1 name
      description: Description
      relations: []
      deliveries: {}
    ring-1:
      name: Ring 2 name
      description: Description
      relations:
        - uses - ring-1
      deliveries:
        delivery-1:
          name: delivery 1
          description: Description
          relations:
            - calls - delivery-2
            - uses - ring-1
          blocks:
            delivery-1--block-1:
              name: block 1
              description: Description
              relations:
                - uses - delivery-1--block-2
                - calls - delivery-2--block-1
                - uses - ring-1
            delivery-1--block-2:
              name: block 2
              description: Description
              relations: []
        delivery-2:
          name: delivery 2
          description: Description
          relations: []
          blocks:
            delivery-2--block-1:
              name: block 1
              description: Description
              relations:
                - uses - delivery-2--block-2
            delivery-2--block-2:
              name: block 2
              description: Description
              relations: []
views:
  view-1:
    elements:
      ring-1:
        x: 100
        y: 100
      delivery-1:
        x: 200
        y: 200
        relations:
          calls - delivery-2:
            - x: 300
              y: 150
          uses - ring-1: []
      delivery-2:
        x: 300
        y: 300
  view-2:
    elements:
      actor-1:
        x: 100
        y: 100
        relations:
          uses - delivery-1: []
      delivery-1:
        x: 200
        y: 200

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.

Duplicated keys in record
3 participants