Skip to content

Commit 080397b

Browse files
chore(deps): update module gomodules.xyz/jsonpatch/v2 to v2.5.0
Signed-off-by: red-hat-konflux <126015336+red-hat-konflux[bot]@users.noreply.github.com>
1 parent 3588cac commit 080397b

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ require (
177177
golang.org/x/text v0.32.0 // indirect
178178
golang.org/x/time v0.12.0 // indirect
179179
golang.org/x/tools v0.39.0 // indirect
180-
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
180+
gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect
181181
google.golang.org/genproto/googleapis/rpc v0.0.0-20250929231259-57b25ae835d4 // indirect
182182
google.golang.org/grpc v1.75.1 // indirect
183183
google.golang.org/protobuf v1.36.9 // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
628628
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
629629
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
630630
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
631-
gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw=
632-
gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
631+
gomodules.xyz/jsonpatch/v2 v2.5.0 h1:JELs8RLM12qJGXU4u/TO3V25KW8GreMKl9pdkk14RM0=
632+
gomodules.xyz/jsonpatch/v2 v2.5.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
633633
google.golang.org/genproto v0.0.0-20250603155806-513f23925822 h1:rHWScKit0gvAPuOnu87KpaYtjK5zBMLcULh7gxkCXu4=
634634
google.golang.org/genproto v0.0.0-20250603155806-513f23925822/go.mod h1:HubltRL7rMh0LfnQPkMH4NPDFEWp0jw3vixw7jEM53s=
635635
google.golang.org/genproto/googleapis/api v0.0.0-20250707201910-8d1bb00bc6a7 h1:FiusG7LWj+4byqhbvmB+Q93B/mOxJLN2DTozDuZm4EU=

vendor/gomodules.xyz/jsonpatch/v2/jsonpatch.go

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,14 @@ func CreatePatch(a, b []byte) ([]Operation, error) {
7070
}
7171
var aI interface{}
7272
var bI interface{}
73-
err := json.Unmarshal(a, &aI)
74-
if err != nil {
73+
aDec := json.NewDecoder(bytes.NewReader(a))
74+
aDec.UseNumber()
75+
if err := aDec.Decode(&aI); err != nil {
7576
return nil, errBadJSONDoc
7677
}
77-
err = json.Unmarshal(b, &bI)
78-
if err != nil {
78+
bDec := json.NewDecoder(bytes.NewReader(b))
79+
bDec.UseNumber()
80+
if err := bDec.Decode(&bI); err != nil {
7981
return nil, errBadJSONDoc
8082
}
8183
return handleValues(aI, bI, "", []Operation{})
@@ -94,6 +96,11 @@ func matchesValue(av, bv interface{}) bool {
9496
if ok && bt == at {
9597
return true
9698
}
99+
case json.Number:
100+
bt, ok := bv.(json.Number)
101+
if ok && bt == at {
102+
return true
103+
}
97104
case float64:
98105
bt, ok := bv.(float64)
99106
if ok && bt == at {
@@ -212,7 +219,7 @@ func handleValues(av, bv interface{}, p string, patch []Operation) ([]Operation,
212219
if err != nil {
213220
return nil, err
214221
}
215-
case string, float64, bool:
222+
case string, float64, bool, json.Number:
216223
if !matchesValue(av, bv) {
217224
patch = append(patch, NewOperation("replace", p, bv))
218225
}

vendor/modules.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ golang.org/x/tools/internal/stdlib
949949
golang.org/x/tools/internal/typeparams
950950
golang.org/x/tools/internal/typesinternal
951951
golang.org/x/tools/internal/versions
952-
# gomodules.xyz/jsonpatch/v2 v2.4.0
952+
# gomodules.xyz/jsonpatch/v2 v2.5.0
953953
## explicit; go 1.20
954954
gomodules.xyz/jsonpatch/v2
955955
# google.golang.org/genproto/googleapis/rpc v0.0.0-20250929231259-57b25ae835d4

0 commit comments

Comments
 (0)