Correct Map keys must be unique
warnings in definitions YAML
#1753
Labels
Milestone
Map keys must be unique
warnings in definitions YAML
#1753
When developers have definitions/shared/linux.yaml open in VS Code and perhaps other editors, they'll observe numerous
Map keys must be unique
errors. These errors don't impact our builds or commands like.\osob-cli.cmd definitions
b/c parsers fromYamlDotNet
ignore the problem and chooses the last value (if the values are different). However the errors make it more difficult to find real problems in the YAML.One issue is with definitions such as
The
<<
pseudo-key appears twice. Our current version ofYamlDotNet
doesn't handle e.g.,<<: [ *Windows11Client, *ServicingSubscription ]
when the merged maps contain lots of references. I haven't tested enough to confirm whether the issue is the depth of references to some of our anchors, the overall complication of our YAML, or something else.likely fix would be to upgrade to a more recent
YamlDotNet
version. We're at v6.0.0 (published 2019-03-15) though v13.7.1 has been out for 3 months (at the time of this writing). Interesting fixes for YAML deserialization include:DeserializerBuilder.WithDuplicateKeyChecking()
when instantiating the builder to take advantage of this new feature<<: [ *Windows11Client, *ServicingSubscription ]
as mentioned above)Release Note Category
Release Note Description
Upgraded to a new
YamlDotNet
version (v13.7.1).The text was updated successfully, but these errors were encountered: