Merge "Disallow unknown fields in soong variables file" into main am: 4eef64a70b am: 142cf7a304

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3114140

Change-Id: I2b5e0f4615f90809a32e1a596dda4c30441dd7d5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot 2024-06-06 18:29:17 +00:00 committed by Automerger Merge Worker
commit ef9fd50b23

View file

@ -375,6 +375,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())