Disallow unknown fields in soong variables file

To catch issues earlier, like when renaming a field.

Test: Presubmits
Change-Id: Ie04507b54cc8de3efd27ee75ff32a85ea21b5750
This commit is contained in:
Cole Faust 2024-06-04 11:10:11 -07:00
parent d5e16ac52b
commit e1129b8cc6

View file

@ -370,6 +370,7 @@ func loadFromConfigFile(configurable *ProductVariables, filename string) error {
} else {
// Make a decoder for it
jsonDecoder := json.NewDecoder(configFileReader)
jsonDecoder.DisallowUnknownFields()
err = jsonDecoder.Decode(configurable)
if err != nil {
return fmt.Errorf("config file: %s did not parse correctly: %s", filename, err.Error())