Closed PatrickDuncan closed 1 year ago
Hi! I no longer maintain Yamale, but I can point out that the yaml spec says that keys in a mapping have no order: https://yaml.org/spec/1.2.2/#3221-mapping-key-order
Since Yamale doesn't actually do the deserialization of the yaml, Yamale couldn't guarantee that it gets the proper order from the library when validation starts.
There are workarounds for each library, but my feeling is that a sequence should be used if you want to maintain order in your yaml.
@mildebrandt Thanks, that limitation makes sense. I think using an array (sequence) has too many tradeoffs with readability and the chance of duplicates with my usecase. I don't think Yamale has a validator for duplicate entries in arrays.
I could create a custom script that does some form of validation.
It would be nice if there was an alphabetical order validator for maps.
Success
Fail
Fail