The interactive editors validate on save with strictJSON[T]() (apps/cinc/cmd/editor.go), which rejects any key the model type doesn't know. That way a typo, or a field the CLI would drop, surfaces as an error instead of silently vanishing and making the edit look like "no change".
--file goes through readJSONFile[T] (apps/cinc/cmd/common.go), a plain json.Unmarshal, so the same unknown key is silently dropped. For example, cinc role edit web --file role.json with a misspelled "overide_attributes" saves without it and reports success.
Make readJSONFile decode with DisallowUnknownFields too, so both paths agree. Watch out for files exported from knife, which carry json_class and chef_type. Either accept those two keys explicitly, or have the cinc-api types model them, so a knife export still loads.
The interactive editors validate on save with
strictJSON[T]()(apps/cinc/cmd/editor.go), which rejects any key the model type doesn't know. That way a typo, or a field the CLI would drop, surfaces as an error instead of silently vanishing and making the edit look like "no change".--filegoes throughreadJSONFile[T](apps/cinc/cmd/common.go), a plainjson.Unmarshal, so the same unknown key is silently dropped. For example,cinc role edit web --file role.jsonwith a misspelled"overide_attributes"saves without it and reports success.Make
readJSONFiledecode withDisallowUnknownFieldstoo, so both paths agree. Watch out for files exported from knife, which carryjson_classandchef_type. Either accept those two keys explicitly, or have the cinc-api types model them, so a knife export still loads.