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

fix: provide more useful error message on duplicate keys in template #46

Merged
merged 5 commits into from
May 3, 2024

Conversation

garrettdieckmann
Copy link
Collaborator

If a mustache view contains data that will cause duplicate keys in the rendered template, when f5-fast-core enters post-processing, yaml.load will return an error similar to:

duplicated mapping key (41:13)

38 |
39 |
40 |
41 |             \"shouldDup\": {
------------------^
42 |                 \"pool\": \"shouldDup\",
43 |               \"persistenceMethods\": [],

The error does not contain enough context for a end-user to understand how to resolve the duplicate keys on their own.

On a duplicate mapping key error, this change updates the error message to be similar to:

parameters must have unique values. The parameter value "shouldDup" is duplicated across parameters and you must update the parameter values to ensure they are unique.

Additional changes in this MR:

  • rolled back Axios to ^0.27.2
  • update to package lock to resolve npm vulnerabilities

@andreykashcheev
Copy link
Collaborator

Looks good!

@garrettdieckmann garrettdieckmann changed the title Fix: Provide more useful error message on duplicate keys in template fix: Provide more useful error message on duplicate keys in template May 3, 2024
@garrettdieckmann garrettdieckmann changed the title fix: Provide more useful error message on duplicate keys in template fix: provide more useful error message on duplicate keys in template May 3, 2024
@garrettdieckmann garrettdieckmann merged commit e45efe2 into master May 3, 2024
4 of 6 checks passed
@garrettdieckmann garrettdieckmann deleted the provide-more-useful-duplicate-key-error branch May 3, 2024 16:38
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