Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Commit

Permalink
update oas lib version
Browse files Browse the repository at this point in the history
  • Loading branch information
srinandan committed Aug 26, 2021
1 parent 9d98a32 commit ea6b0c2
Show file tree
Hide file tree
Showing 3 changed files with 557 additions and 70 deletions.
12 changes: 6 additions & 6 deletions bundlegen/generateapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@ type pathDetailDef struct {

var generateOAuthPolicy, generateAPIKeyPolicy bool

var doc *openapi3.Swagger
var doc *openapi3.T

func LoadDocumentFromFile(filePath string, validate bool) (string, []byte, error) {
var err error
var jsonContent []byte

doc, err = openapi3.NewSwaggerLoader().LoadSwaggerFromFile(filePath)
doc, err = openapi3.NewLoader().LoadFromFile(filePath)
if err != nil {
return "", nil, err
}

if validate {
if err = doc.Validate(openapi3.NewSwaggerLoader().Context); err != nil {
if err = doc.Validate(openapi3.NewLoader().Context); err != nil {
return "", nil, err
}
}
Expand All @@ -76,13 +76,13 @@ func LoadDocumentFromURI(uri string, validate bool) (string, []byte, error) {
return "", nil, err
}

doc, err = openapi3.NewSwaggerLoader().LoadSwaggerFromURI(u)
doc, err = openapi3.NewLoader().LoadFromURI(u)
if err != nil {
return "", nil, err
}

if validate {
if err = doc.Validate(openapi3.NewSwaggerLoader().Context); err != nil {
if err = doc.Validate(openapi3.NewLoader().Context); err != nil {
return "", nil, err
}
}
Expand Down Expand Up @@ -165,7 +165,7 @@ func GenerateAPIProxyDefFromOAS(name string, oasDocName string, skipPolicy bool,
return nil
}

func GetEndpoint(doc *openapi3.Swagger) (u *url.URL, err error) {
func GetEndpoint(doc *openapi3.T) (u *url.URL, err error) {
if doc.Servers == nil {
return nil, fmt.Errorf("at least one server must be present")
}
Expand Down
11 changes: 5 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
module github.com/srinandan/apigeecli

go 1.12
go 1.16

require (
github.com/getkin/kin-openapi v0.3.1
github.com/getkin/kin-openapi v0.74.0
github.com/ghodss/yaml v1.0.0
github.com/lestrrat-go/jwx v1.0.1
github.com/lestrrat/go-jwx v0.0.0-20180221005942-b7d4802280ae
github.com/lestrrat/go-jwx v0.0.0-20210302221443-a9d01c1b7121
github.com/lestrrat/go-pdebug v0.0.0-20180220043741-569c97477ae8 // indirect
github.com/spf13/cobra v0.0.5
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/cobra v1.2.1
github.com/thedevsaddam/gojsonq v2.2.2+incompatible
gopkg.in/yaml.v2 v2.2.8
gopkg.in/yaml.v2 v2.4.0
)
Loading

0 comments on commit ea6b0c2

Please sign in to comment.