diff --git a/api/config/v2alpha2/opaconfig_types.go b/api/config/v2alpha2/opaconfig_types.go index 1b89510f..324eb81d 100644 --- a/api/config/v2alpha2/opaconfig_types.go +++ b/api/config/v2alpha2/opaconfig_types.go @@ -66,7 +66,10 @@ func (c *OPAConfigSpec) UnmarshalJSON(data []byte) error { return err } - var decoded OPAConfigSpec + // Use a local alias to avoid infinite recursion: json.Unmarshal on the + // alias type uses the default struct decoder, bypassing this method. + type alias OPAConfigSpec + var decoded alias if err := json.Unmarshal(data, &decoded); err != nil { return err }