This commit is contained in:
Andrew Nester 2024-10-11 12:47:15 +02:00
parent cf2ab73903
commit 35f2d58180
No known key found for this signature in database
GPG Key ID: 12BC628A44B7DA57
1 changed files with 3 additions and 3 deletions

View File

@ -60,17 +60,17 @@ func (j *JsonFlag) Unmarshal(v any) diag.Diagnostics {
// It will serialize all set data with the correct types. // It will serialize all set data with the correct types.
data, err := json.Marshal(nv.AsAny()) data, err := json.Marshal(nv.AsAny())
if err != nil { if err != nil {
return diag.FromErr(err) return diags.Extend(diag.FromErr(err))
} }
// Finally unmarshal the normalized data to the output. // Finally unmarshal the normalized data to the output.
// It will fill in the ForceSendFields field if the struct contains it. // It will fill in the ForceSendFields field if the struct contains it.
err = marshal.Unmarshal(data, v) err = marshal.Unmarshal(data, v)
if err != nil { if err != nil {
return diag.FromErr(err) return diags.Extend(diag.FromErr(err))
} }
return nil return diags
} }
func (j *JsonFlag) Type() string { func (j *JsonFlag) Type() string {