Skip to content

Commit

Permalink
add pkg paths to fix clashing
Browse files Browse the repository at this point in the history
  • Loading branch information
candiduslynx committed Oct 4, 2023
1 parent f3525d5 commit 071a80f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ require (
golang.org/x/exp v0.0.0-20230905200255-921286631fa9
)

// https://github.com/invopop/jsonschema/pull/106
replace github.com/invopop/jsonschema => github.com/cloudquery/jsonschema v0.0.0-20231004102900-26eed64ef87a

require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.2 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPn
github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg=
github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs=
github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
github.com/cloudquery/jsonschema v0.0.0-20231004102900-26eed64ef87a h1:nMaPG7Hlvt5c90scdRoyUpOhkkgkP8v+nlq3bBuWi4E=
github.com/cloudquery/jsonschema v0.0.0-20231004102900-26eed64ef87a/go.mod h1:ffZ5Km5SWWRAIN6wbDXItl95euhFz2uON45H2qjYt+0=
github.com/cloudquery/plugin-sdk/v4 v4.12.0 h1:vNPptFUZYLAaG/9ktm7bnRBrR72+rN28rpPC62TSuXA=
github.com/cloudquery/plugin-sdk/v4 v4.12.0/go.mod h1:gvX/+uoZSxH+hJ/4qqE56jm6tJhJyQ+4RVroKACtkp4=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
Expand All @@ -27,8 +29,6 @@ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/invopop/jsonschema v0.11.0 h1:tdAVvos5ttrsYLyEuVymkVVK31EFpwnTu5hWiyYLGWA=
github.com/invopop/jsonschema v0.11.0/go.mod h1:ffZ5Km5SWWRAIN6wbDXItl95euhFz2uON45H2qjYt+0=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/jpillora/longestcommon v0.0.0-20161227235612-adb9d91ee629 h1:1dSBUfGlorLAua2CRx0zFN7kQsTpE2DQSmr7rrTNgY8=
github.com/jpillora/longestcommon v0.0.0-20161227235612-adb9d91ee629/go.mod h1:mb5nS4uRANwOJSZj8rlCWAfAcGi72GGMIXx+xGOjA7M=
Expand Down
4 changes: 2 additions & 2 deletions jsonschema/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ func Example_basicSchema() {
// {
// "$schema": "https://json-schema.org/draft/2020-12/schema",
// "$id": "https://github.com/cloudquery/codegen/jsonschema_test/basic",
// "$ref": "#/$defs/basic",
// "$ref": "#/$defs/github.com~1cloudquery~1codegen~1jsonschema_test~1basic",
// "$defs": {
// "basic": {
// "github.com/cloudquery/codegen/jsonschema_test/basic": {
// "properties": {
// "a": {
// "type": "string",
Expand Down
2 changes: 1 addition & 1 deletion jsonschema/jsonschema.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
// Generate returns a formatted JSON schema for the input struct, according to the tags
// defined by https://github.com/invopop/jsonschema
func Generate(a any) ([]byte, error) {
sc := (&jsonschema.Reflector{RequiredFromJSONSchemaTags: true}).Reflect(a)
sc := (&jsonschema.Reflector{RequiredFromJSONSchemaTags: true, NamesWithPkg: true}).Reflect(a)
return json.MarshalIndent(sc, "", " ")
}

Expand Down

0 comments on commit 071a80f

Please sign in to comment.