How to validate yaml file in v4 to make sure there are no duplicate keys? #1207
Answered
by
mikefarah
shreyaspurohit
asked this question in
Q&A
-
I have a yaml file like
The Is it possible to use yq to validate and make sure the yaml file doesn't have duplicate map keys? |
Beta Was this translation helpful? Give feedback.
Answered by
mikefarah
May 6, 2022
Replies: 1 comment
-
No sorry - the underlying parser slurps up the yaml file - and (from memory) it will use the latest value for the key. yq doesn't have a way of knowing that it was duplicated. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
shreyaspurohit
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No sorry - the underlying parser slurps up the yaml file - and (from memory) it will use the latest value for the key. yq doesn't have a way of knowing that it was duplicated.