Skip to content

Commit

Permalink
Get rid of jsoninfo
Browse files Browse the repository at this point in the history
- following up on getkin/kin-openapi#728
  remove use of jsoninfo
- Pin version of mergo to v0.3.12.  v0.3.14 doesn't work the same or is buggy.
- getSchemaList: Remove some unecessary step YAML->JSON, prefer JSON and data when possible
  • Loading branch information
fridim committed Mar 17, 2023
1 parent f4ca164 commit d537b38
Show file tree
Hide file tree
Showing 7 changed files with 154 additions and 81 deletions.
10 changes: 8 additions & 2 deletions cli/agnosticv_test.go
Expand Up @@ -436,8 +436,14 @@ func TestSchemaValidationPatternFailed(t *testing.T) {
}
errValidation := validateAgainstSchemas(path, merged)

if !strings.Contains(errValidation.Error(), "Error at \"/__meta__/lifespan/default\": string doesn't match the regular expression") {
t.Error("ErrorSchema not found", errValidation)
if errValidation == nil {
t.Error("Error expected")
} else {
if !strings.Contains(
errValidation.Error(),
"Error at \"/__meta__/lifespan/default\": string doesn't match the regular expression") {
t.Error("ErrorSchema not found", errValidation)
}
}
}

Expand Down
12 changes: 6 additions & 6 deletions cli/config.go
Expand Up @@ -9,16 +9,16 @@ import (
)

type RelatedFile struct {
File string `json:"file"`
LoadInto string `json:"load_into"`
ContentKey string `json:"content_key"`
Set map[string]interface{} `json:"set"`
File string `json:"file"`
LoadInto string `json:"load_into"`
ContentKey string `json:"content_key"`
Set map[string]interface{} `json:"set"`
}

type Config struct {
// For any leaf file, consider those in same directory as related files:
RelatedFiles []string `json:"related_files"`
RelatedFilesV2 []RelatedFile`json:"related_files_v2"`
RelatedFiles []string `json:"related_files"`
RelatedFilesV2 []RelatedFile `json:"related_files_v2"`

// Plumbing variable to know when config was loaded from disk.
initialized bool
Expand Down
39 changes: 22 additions & 17 deletions cli/go.mod
@@ -1,36 +1,41 @@
module github.com/redhat-cop/agnosticv/cli

go 1.18
go 1.20

require (
github.com/getkin/kin-openapi v0.94.0
github.com/getkin/kin-openapi v0.115.0
github.com/ghodss/yaml v1.0.0
github.com/go-git/go-git/v5 v5.4.2
github.com/go-openapi/jsonpointer v0.19.5
github.com/go-openapi/jsonpointer v0.19.6
github.com/imdario/mergo v0.3.12
github.com/jmespath/go-jmespath v0.4.0
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826
gopkg.in/yaml.v2 v2.4.0
)

require (
github.com/Microsoft/go-winio v0.4.16 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 // indirect
github.com/acomagu/bufpipe v1.0.3 // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/Microsoft/go-winio v0.6.0 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230316153859-cb82d937a5d9 // indirect
github.com/acomagu/bufpipe v1.0.4 // indirect
github.com/cloudflare/circl v1.3.2 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-git/go-billy/v5 v5.3.1 // indirect
github.com/go-openapi/swag v0.19.15 // indirect
github.com/go-git/go-billy/v5 v5.4.1 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/invopop/yaml v0.2.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/stretchr/testify v1.7.2 // indirect
github.com/xanzy/ssh-agent v0.3.0 // indirect
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b // indirect
golang.org/x/net v0.0.0-20210326060303-6b1517762897 // indirect
golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79 // indirect
github.com/perimeterx/marshmallow v1.1.4 // indirect
github.com/sergi/go-diff v1.3.1 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
golang.org/x/crypto v0.7.0 // indirect
golang.org/x/mod v0.9.0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/tools v0.7.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

0 comments on commit d537b38

Please sign in to comment.