Open SteveL-MSFT opened 1 month ago
This could be resolved okay with a note in the documentation - fwiw, users who are defining their configuration documents in VS Code with the YAML extension will get author-time feedback that an object can't define the same property twice, so even though DSC isn't currently raising an error, the user has some way to know that defining the same key twice in an object isn't supported.
Agree this could just be doc'd so we can focus on other items. I already spent too much time trying to figure out how to get it to not accept dupes, but existing solutions I found only worked if it wasn't an Option<>
which is needed in our case.
@michaeltlombardi just close this as resolved once documented
Prerequisites
Summary
Due to default
serde
behavior, duplicates in deserializing aHashMap
is not an error and last one wins. There is another crateserde_with
that has a macro that prevents dupes, but it doesn't work if the property is anOption<>
. Tried a few ways to resolve this, but couldn't find a solutiont hat doesn't include implementing a custom deserializer. Deferring this work.Steps to reproduce
Expected behavior
Actual behavior
Error details
No response
Environment data
Version
dsc 3.0.0-preview.8
Visuals
No response