Skip to content

Commit 413453c

Browse files
authored
fix(deps): Update module github.com/santhosh-tekuri/jsonschema/v5 to v6 (#1782)
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/santhosh-tekuri/jsonschema/v5](https://togithub.com/santhosh-tekuri/jsonschema) | require | major | `v5.3.1` -> `v6.0.1` | --- ### Release Notes <details> <summary>santhosh-tekuri/jsonschema (github.com/santhosh-tekuri/jsonschema/v5)</summary> ### [`v6.0.1`](https://togithub.com/santhosh-tekuri/jsonschema/releases/tag/v6.0.1) [Compare Source](https://togithub.com/santhosh-tekuri/jsonschema/compare/v6.0.0...v6.0.1) Bug Fixes: - fix/schema: field RecursiveRef misspelled - fix/schema: missing Deprecated field ### [`v6.0.0`](https://togithub.com/santhosh-tekuri/jsonschema/releases/tag/v6.0.0) [Compare Source](https://togithub.com/santhosh-tekuri/jsonschema/compare/v5.3.1...v6.0.0) ### Improvements - mixed dialect support - custom `$vocabulary` support - `sermver` format - support for localisation for `ValidationError` - command `jv` - support stdin - `--insecure` and `--cacert` flag - `--quiet` flag </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on the first day of the month" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjEuMyIsInVwZGF0ZWRJblZlciI6IjM3LjQyNS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
1 parent 602699e commit 413453c

File tree

6 files changed

+20
-11
lines changed

6 files changed

+20
-11
lines changed

examples/simple_plugin/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ require (
3939
github.com/oapi-codegen/runtime v1.1.1 // indirect
4040
github.com/pierrec/lz4/v4 v4.1.21 // indirect
4141
github.com/pmezard/go-difflib v1.0.0 // indirect
42-
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect
42+
github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 // indirect
4343
github.com/spf13/cobra v1.8.1 // indirect
4444
github.com/spf13/pflag v1.0.5 // indirect
4545
github.com/stretchr/testify v1.9.0 // indirect

examples/simple_plugin/go.sum

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t
2727
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
2828
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
2929
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
30+
github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI=
31+
github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
3032
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
3133
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
3234
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
@@ -90,8 +92,8 @@ github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
9092
github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8=
9193
github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
9294
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
93-
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4=
94-
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY=
95+
github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 h1:PKK9DyHxif4LZo+uQSgXNqs0jj5+xZwwfKHgph2lxBw=
96+
github.com/santhosh-tekuri/jsonschema/v6 v6.0.1/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU=
9597
github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM=
9698
github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y=
9799
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ require (
1414
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0
1515
github.com/invopop/jsonschema v0.12.0
1616
github.com/rs/zerolog v1.33.0
17-
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1
17+
github.com/santhosh-tekuri/jsonschema/v6 v6.0.1
1818
github.com/spf13/cobra v1.8.1
1919
github.com/stretchr/testify v1.9.0
2020
github.com/thoas/go-funk v0.9.3

go.sum

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t
2727
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
2828
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
2929
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
30+
github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI=
31+
github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
3032
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
3133
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
3234
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
@@ -90,8 +92,8 @@ github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
9092
github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8=
9193
github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
9294
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
93-
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4=
94-
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY=
95+
github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 h1:PKK9DyHxif4LZo+uQSgXNqs0jj5+xZwwfKHgph2lxBw=
96+
github.com/santhosh-tekuri/jsonschema/v6 v6.0.1/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU=
9597
github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM=
9698
github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y=
9799
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=

plugin/plugin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/cloudquery/plugin-sdk/v4/message"
1111
"github.com/cloudquery/plugin-sdk/v4/schema"
1212
"github.com/rs/zerolog"
13-
"github.com/santhosh-tekuri/jsonschema/v5"
13+
"github.com/santhosh-tekuri/jsonschema/v6"
1414
)
1515

1616
var ErrNotImplemented = fmt.Errorf("not implemented")

plugin/validate.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"strings"
88

99
"github.com/cloudquery/plugin-sdk/v4/schema"
10-
"github.com/santhosh-tekuri/jsonschema/v5"
10+
"github.com/santhosh-tekuri/jsonschema/v6"
1111
)
1212

1313
func validateTables(tables schema.Tables) error {
@@ -37,9 +37,14 @@ func (p *Plugin) validate(ctx context.Context) error {
3737

3838
func JSONSchemaValidator(jsonSchema string) (*jsonschema.Schema, error) {
3939
c := jsonschema.NewCompiler()
40-
c.Draft = jsonschema.Draft2020
41-
c.AssertFormat = true
42-
if err := c.AddResource("schema.json", strings.NewReader(jsonSchema)); err != nil {
40+
c.DefaultDraft(jsonschema.Draft2020)
41+
c.AssertFormat()
42+
43+
s, err := jsonschema.UnmarshalJSON(strings.NewReader(jsonSchema))
44+
if err != nil {
45+
return nil, err
46+
}
47+
if err := c.AddResource("schema.json", s); err != nil {
4348
return nil, err
4449
}
4550
return c.Compile("schema.json")

0 commit comments

Comments
 (0)