DSC icon indicating copy to clipboard operation
DSC copied to clipboard

Replace `deny_unknown_fields` with warn and ignore logic

Open andyleejordan opened this issue 2 months ago • 1 comments

Just a heads up that as noted in the PR, Bicep has and will likely continue to add new fields (especially when using experimental features) and since we're setting #[serde(deny_unknown_fields)] we're allowing that to break us rather than warn us. I highly recommend we switch from that to an ignore and warn approach instead. /cc @michaeltlombardi

Originally posted by @andyleejordan in https://github.com/PowerShell/DSC/issues/1210#issuecomment-3459127353

andyleejordan avatar Oct 29 '25 18:10 andyleejordan

We can remove the additionalProperties and/or unevaluatedProperties keywords fairly easily. It's possibly worth considering an ARM form for the configuration document, where we remove those keywords.

My main concern is that if we relax the schema validation, it becomes harder to detect whether you have mistyped a property name or are using an invalid construct. We should definitely loosen the underlying requirements on the struct definition but I think we should probably keep the keyword for validating general configuration documents.

michaeltlombardi avatar Nov 04 '25 14:11 michaeltlombardi