diff --git a/cache.go b/cache.go index 537f53a..122993b 100644 --- a/cache.go +++ b/cache.go @@ -16,8 +16,6 @@ package spec import ( "sync" - - jsoniter "github.com/json-iterator/go" ) // ResolutionCache a cache for resolving urls @@ -73,8 +71,7 @@ var ( resCache *simpleCache onceCache sync.Once - _ ResolutionCache = &simpleCache{} - json jsoniter.API + _ ResolutionCache = &simpleCache{} ) // initResolutionCache initializes the URI resolution cache. To be wrapped in a sync.Once.Do call. @@ -82,10 +79,6 @@ func initResolutionCache() { resCache = defaultResolutionCache() } -func init() { - json = jsoniter.ConfigFastest -} - func defaultResolutionCache() *simpleCache { return &simpleCache{store: map[string]interface{}{ "http://swagger.io/v2/schema.json": MustLoadSwagger20Schema(), diff --git a/circular_test.go b/circular_test.go index 9e2eb5f..915477f 100644 --- a/circular_test.go +++ b/circular_test.go @@ -8,6 +8,7 @@ import ( "testing" "time" + json "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/contact_info.go b/contact_info.go index 41d210f..68bf4f1 100644 --- a/contact_info.go +++ b/contact_info.go @@ -16,6 +16,7 @@ package spec import ( "github.com/go-openapi/swag" + json "github.com/goccy/go-json" ) // ContactInfo contact information for the exposed API. diff --git a/contact_info_test.go b/contact_info_test.go index 97cbd5f..3179f87 100644 --- a/contact_info_test.go +++ b/contact_info_test.go @@ -17,6 +17,7 @@ package spec import ( "testing" + json "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/expander.go b/expander.go index 124616c..658d0e6 100644 --- a/expander.go +++ b/expander.go @@ -15,8 +15,9 @@ package spec import ( - stdjson "encoding/json" "fmt" + + json "github.com/goccy/go-json" ) // ExpandOptions provides options for the spec expander. @@ -28,11 +29,11 @@ import ( // // PathLoader injects a document loading method. By default, this resolves to the function provided by the SpecLoader package variable. type ExpandOptions struct { - RelativeBase string // the path to the root document to expand. This is a file, not a directory - SkipSchemas bool // do not expand schemas, just paths, parameters and responses - ContinueOnError bool // continue expanding even after and error is found - PathLoader func(string) (stdjson.RawMessage, error) `json:"-"` // the document loading method that takes a path as input and yields a json document - AbsoluteCircularRef bool // circular $ref remaining after expansion remain absolute URLs + RelativeBase string // the path to the root document to expand. This is a file, not a directory + SkipSchemas bool // do not expand schemas, just paths, parameters and responses + ContinueOnError bool // continue expanding even after and error is found + PathLoader func(string) (json.RawMessage, error) `json:"-"` // the document loading method that takes a path as input and yields a json document + AbsoluteCircularRef bool // circular $ref remaining after expansion remain absolute URLs } func optionsOrDefault(opts *ExpandOptions) *ExpandOptions { diff --git a/expander_test.go b/expander_test.go index a218d36..cd59acb 100644 --- a/expander_test.go +++ b/expander_test.go @@ -15,7 +15,6 @@ package spec import ( - stdjson "encoding/json" "io" "log" "net/http" @@ -24,6 +23,7 @@ import ( "path/filepath" "testing" + json "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -38,7 +38,7 @@ const ( var ( // PetStoreJSONMessage json raw message for Petstore20 - PetStoreJSONMessage = stdjson.RawMessage([]byte(PetStore20)) + PetStoreJSONMessage = json.RawMessage([]byte(PetStore20)) specs = filepath.Join("fixtures", "specs") ) diff --git a/go.mod b/go.mod index d57926a..0bddb90 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ require ( github.com/go-openapi/jsonpointer v0.20.2 github.com/go-openapi/jsonreference v0.20.4 github.com/go-openapi/swag v0.22.6 - github.com/json-iterator/go v1.1.12 + github.com/goccy/go-json v0.10.2 github.com/stretchr/testify v1.8.4 gopkg.in/yaml.v3 v3.0.1 ) @@ -13,8 +13,6 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect ) diff --git a/go.sum b/go.sum index ca17d9f..82738e8 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,3 @@ -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q= @@ -7,25 +6,17 @@ github.com/go-openapi/jsonreference v0.20.4 h1:bKlDxQxQJgwpUSgOENiMPzCTBVuc7vTdX github.com/go-openapi/jsonreference v0.20.4/go.mod h1:5pZJyJP2MnYCpoeoMAql78cCHauHj0V9Lhc506VOpw4= github.com/go-openapi/swag v0.22.6 h1:dnqg1XfHXL9aBxSbktBqFR5CxVyVI+7fYWhAf1JOeTw= github.com/go-openapi/swag v0.22.6/go.mod h1:Gl91UqO+btAM0plGGxHqJcQZ1ZTy6jbmridBTsDy8A0= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/header.go b/header.go index b4d1249..6340c38 100644 --- a/header.go +++ b/header.go @@ -19,6 +19,7 @@ import ( "github.com/go-openapi/jsonpointer" "github.com/go-openapi/swag" + json "github.com/goccy/go-json" ) const ( diff --git a/header_test.go b/header_test.go index 898f3de..2a1658b 100644 --- a/header_test.go +++ b/header_test.go @@ -18,6 +18,7 @@ import ( "testing" "github.com/go-openapi/swag" + json "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/helpers_spec_test.go b/helpers_spec_test.go index df8ab5d..5f75290 100644 --- a/helpers_spec_test.go +++ b/helpers_spec_test.go @@ -1,8 +1,6 @@ package spec_test import ( - "encoding/json" - stdjson "encoding/json" "fmt" "regexp" "strings" @@ -10,18 +8,19 @@ import ( "github.com/go-openapi/spec" "github.com/go-openapi/swag" + json "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) var ( rex = regexp.MustCompile(`"\$ref":\s*"(.*?)"`) - testLoader func(string) (stdjson.RawMessage, error) + testLoader func(string) (json.RawMessage, error) ) func init() { // mimics what the go-openapi/load does - testLoader = func(path string) (stdjson.RawMessage, error) { + testLoader = func(path string) (json.RawMessage, error) { if swag.YAMLMatcher(path) { return swag.YAMLDoc(path) } @@ -29,7 +28,7 @@ func init() { if err != nil { return nil, err } - return stdjson.RawMessage(data), nil + return json.RawMessage(data), nil } } diff --git a/helpers_test.go b/helpers_test.go index e90a182..3f2a5c7 100644 --- a/helpers_test.go +++ b/helpers_test.go @@ -1,25 +1,25 @@ package spec import ( - stdjson "encoding/json" "fmt" "regexp" "strings" "testing" "github.com/go-openapi/swag" + json "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) var rex = regexp.MustCompile(`"\$ref":\s*"(.*?)"`) -func jsonDoc(path string) (stdjson.RawMessage, error) { +func jsonDoc(path string) (json.RawMessage, error) { data, err := swag.LoadFromFileOrHTTP(path) if err != nil { return nil, err } - return stdjson.RawMessage(data), nil + return json.RawMessage(data), nil } func docAndOpts(t testing.TB, fixturePath string) ([]byte, *ExpandOptions) { diff --git a/info.go b/info.go index 1cf7e67..b9f1a2b 100644 --- a/info.go +++ b/info.go @@ -20,6 +20,7 @@ import ( "github.com/go-openapi/jsonpointer" "github.com/go-openapi/swag" + json "github.com/goccy/go-json" ) // Extensions vendor specific extensions diff --git a/info_test.go b/info_test.go index c98aa2d..183cb9e 100644 --- a/info_test.go +++ b/info_test.go @@ -17,6 +17,7 @@ package spec import ( "testing" + json "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/items.go b/items.go index a128b03..b071b13 100644 --- a/items.go +++ b/items.go @@ -19,6 +19,7 @@ import ( "github.com/go-openapi/jsonpointer" "github.com/go-openapi/swag" + json "github.com/goccy/go-json" ) const ( diff --git a/items_test.go b/items_test.go index d1b34c3..043bbd5 100644 --- a/items_test.go +++ b/items_test.go @@ -18,6 +18,7 @@ import ( "testing" "github.com/go-openapi/swag" + json "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/license.go b/license.go index a0a3aa3..fd294cf 100644 --- a/license.go +++ b/license.go @@ -16,6 +16,7 @@ package spec import ( "github.com/go-openapi/swag" + json "github.com/goccy/go-json" ) // License information for the exposed API. diff --git a/license_test.go b/license_test.go index 2000338..40b8bb5 100644 --- a/license_test.go +++ b/license_test.go @@ -17,6 +17,7 @@ package spec import ( "testing" + json "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/operation.go b/operation.go index 9789af0..6aedabd 100644 --- a/operation.go +++ b/operation.go @@ -21,6 +21,7 @@ import ( "github.com/go-openapi/jsonpointer" "github.com/go-openapi/swag" + json "github.com/goccy/go-json" ) func init() { diff --git a/operation_test.go b/operation_test.go index 065af2c..a14c5d5 100644 --- a/operation_test.go +++ b/operation_test.go @@ -19,6 +19,7 @@ import ( "encoding/gob" "testing" + json "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/parameter.go b/parameter.go index f96c22c..e5fec5f 100644 --- a/parameter.go +++ b/parameter.go @@ -19,6 +19,7 @@ import ( "github.com/go-openapi/jsonpointer" "github.com/go-openapi/swag" + json "github.com/goccy/go-json" ) // QueryParam creates a query parameter diff --git a/parameters_test.go b/parameters_test.go index 86d5925..623b3aa 100644 --- a/parameters_test.go +++ b/parameters_test.go @@ -18,6 +18,7 @@ import ( "testing" "github.com/go-openapi/swag" + json "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/path_item.go b/path_item.go index e698c63..21be1fe 100644 --- a/path_item.go +++ b/path_item.go @@ -17,6 +17,7 @@ package spec import ( "github.com/go-openapi/jsonpointer" "github.com/go-openapi/swag" + json "github.com/goccy/go-json" ) // PathItemProps the path item specific properties diff --git a/path_item_test.go b/path_item_test.go index 4c9e0a6..fdaafdd 100644 --- a/path_item_test.go +++ b/path_item_test.go @@ -17,6 +17,7 @@ package spec import ( "testing" + json "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/paths.go b/paths.go index ca87b84..41472b7 100644 --- a/paths.go +++ b/paths.go @@ -18,9 +18,8 @@ import ( "fmt" "strings" - stdjson "encoding/json" - "github.com/go-openapi/swag" + json "github.com/goccy/go-json" ) // Paths holds the relative paths to the individual endpoints. @@ -47,7 +46,7 @@ func (p Paths) JSONLookup(token string) (interface{}, error) { // UnmarshalJSON hydrates this items instance with the data from JSON func (p *Paths) UnmarshalJSON(data []byte) error { - var res map[string]stdjson.RawMessage + var res map[string]json.RawMessage if err := json.Unmarshal(data, &res); err != nil { return err } diff --git a/paths_test.go b/paths_test.go index f44f8d2..b1ee023 100644 --- a/paths_test.go +++ b/paths_test.go @@ -17,6 +17,7 @@ package spec import ( "testing" + json "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/properties.go b/properties.go index ad7fcef..81871a4 100644 --- a/properties.go +++ b/properties.go @@ -4,6 +4,8 @@ import ( "bytes" "reflect" "sort" + + json "github.com/goccy/go-json" ) // OrderSchemaItem holds a named schema (e.g. from a property of an object) diff --git a/ref.go b/ref.go index 6e7ceaa..eadf635 100644 --- a/ref.go +++ b/ref.go @@ -22,6 +22,7 @@ import ( "path/filepath" "github.com/go-openapi/jsonreference" + json "github.com/goccy/go-json" ) // Refable is a struct for things that accept a $ref property diff --git a/ref_test.go b/ref_test.go index 7deb3c9..8f47653 100644 --- a/ref_test.go +++ b/ref_test.go @@ -19,6 +19,7 @@ import ( "encoding/gob" "testing" + json "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/resolver_test.go b/resolver_test.go index a4b0d02..7a3e143 100644 --- a/resolver_test.go +++ b/resolver_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/go-openapi/jsonpointer" + json "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/response.go b/response.go index cac496f..06dd2ae 100644 --- a/response.go +++ b/response.go @@ -17,6 +17,7 @@ package spec import ( "github.com/go-openapi/jsonpointer" "github.com/go-openapi/swag" + json "github.com/goccy/go-json" ) // ResponseProps properties specific to a response diff --git a/response_test.go b/response_test.go index f2715ad..640f4bc 100644 --- a/response_test.go +++ b/response_test.go @@ -17,6 +17,7 @@ package spec import ( "testing" + json "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/responses.go b/responses.go index 1d36303..ecc5aec 100644 --- a/responses.go +++ b/responses.go @@ -15,13 +15,13 @@ package spec import ( - stdjson "encoding/json" "fmt" "reflect" "strconv" "strings" "github.com/go-openapi/swag" + json "github.com/goccy/go-json" ) // Responses is a container for the expected responses of an operation. @@ -109,7 +109,7 @@ func (r ResponsesProps) MarshalJSON() ([]byte, error) { // UnmarshalJSON unmarshals responses from JSON func (r *ResponsesProps) UnmarshalJSON(data []byte) error { - var res map[string]stdjson.RawMessage + var res map[string]json.RawMessage if err := json.Unmarshal(data, &res); err != nil { return err } diff --git a/responses_test.go b/responses_test.go index a2f8766..dff05f6 100644 --- a/responses_test.go +++ b/responses_test.go @@ -17,6 +17,7 @@ package spec import ( "testing" + json "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/schema.go b/schema.go index d3756f6..6936ad6 100644 --- a/schema.go +++ b/schema.go @@ -20,6 +20,7 @@ import ( "github.com/go-openapi/jsonpointer" "github.com/go-openapi/swag" + json "github.com/goccy/go-json" ) // BooleanProperty creates a boolean property diff --git a/schema_loader.go b/schema_loader.go index 20865c3..6662823 100644 --- a/schema_loader.go +++ b/schema_loader.go @@ -15,7 +15,6 @@ package spec import ( - stdjson "encoding/json" "fmt" "log" "net/url" @@ -23,6 +22,7 @@ import ( "strings" "github.com/go-openapi/swag" + json "github.com/goccy/go-json" ) // PathLoader is a function to use when loading remote refs. @@ -33,12 +33,12 @@ import ( // NOTE: if you are using the go-openapi/loads package, it will override // this value with its own default (a loader to retrieve YAML documents as // well as JSON ones). -var PathLoader = func(pth string) (stdjson.RawMessage, error) { +var PathLoader = func(pth string) (json.RawMessage, error) { data, err := swag.LoadFromFileOrHTTP(pth) if err != nil { return nil, err } - return stdjson.RawMessage(data), nil + return json.RawMessage(data), nil } // resolverContext allows to share a context during spec processing. @@ -50,7 +50,7 @@ type resolverContext struct { // concurrent access, unless we chose to implement a parallel spec walking. circulars map[string]bool basePath string - loadDoc func(string) (stdjson.RawMessage, error) + loadDoc func(string) (json.RawMessage, error) rootID string } @@ -58,7 +58,7 @@ func newResolverContext(options *ExpandOptions) *resolverContext { expandOptions := optionsOrDefault(options) // path loader may be overridden by options - var loader func(string) (stdjson.RawMessage, error) + var loader func(string) (json.RawMessage, error) if expandOptions.PathLoader == nil { loader = PathLoader } else { @@ -77,7 +77,7 @@ type schemaLoader struct { options *ExpandOptions cache ResolutionCache context *resolverContext - loadDoc func(string) (stdjson.RawMessage, error) + loadDoc func(string) (json.RawMessage, error) } func (r *schemaLoader) transitiveResolver(basePath string, ref Ref) *schemaLoader { @@ -328,7 +328,7 @@ func defaultSchemaLoader( options: expandOptions, cache: cache, context: context, - loadDoc: func(path string) (stdjson.RawMessage, error) { + loadDoc: func(path string) (json.RawMessage, error) { debugLog("fetching document at %q", path) return PathLoader(path) }, diff --git a/schema_loader_test.go b/schema_loader_test.go index 15a191d..d2e45d8 100644 --- a/schema_loader_test.go +++ b/schema_loader_test.go @@ -4,6 +4,7 @@ import ( "path/filepath" "testing" + json "github.com/goccy/go-json" "github.com/stretchr/testify/require" ) diff --git a/schema_test.go b/schema_test.go index 1dae698..c17a8e8 100644 --- a/schema_test.go +++ b/schema_test.go @@ -18,6 +18,7 @@ import ( "testing" "github.com/go-openapi/swag" + json "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/security_scheme.go b/security_scheme.go index 25e045f..81481dc 100644 --- a/security_scheme.go +++ b/security_scheme.go @@ -17,6 +17,7 @@ package spec import ( "github.com/go-openapi/jsonpointer" "github.com/go-openapi/swag" + json "github.com/goccy/go-json" ) const ( diff --git a/spec.go b/spec.go index ee72f30..c44a717 100644 --- a/spec.go +++ b/spec.go @@ -19,6 +19,10 @@ package spec //go:generate go-bindata -pkg=spec -prefix=./schemas -ignore=.*\.md ./schemas/... //go:generate perl -pi -e s,Json,JSON,g bindata.go +import ( + json "github.com/goccy/go-json" +) + const ( // SwaggerSchemaURL the url for the swagger 2.0 schema to validate specs SwaggerSchemaURL = "http://swagger.io/v2/schema.json#" diff --git a/structs_test.go b/structs_test.go index d0cad38..f5de6d4 100644 --- a/structs_test.go +++ b/structs_test.go @@ -18,6 +18,7 @@ import ( "reflect" "testing" + json "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "gopkg.in/yaml.v3" ) diff --git a/swagger.go b/swagger.go index d17df08..6294253 100644 --- a/swagger.go +++ b/swagger.go @@ -22,6 +22,7 @@ import ( "github.com/go-openapi/jsonpointer" "github.com/go-openapi/swag" + json "github.com/goccy/go-json" ) // Swagger this is the root document object for the API specification. diff --git a/swagger_test.go b/swagger_test.go index 1954da7..abbae7e 100644 --- a/swagger_test.go +++ b/swagger_test.go @@ -17,6 +17,7 @@ package spec import ( "testing" + json "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/tag.go b/tag.go index a2af8af..70ad299 100644 --- a/tag.go +++ b/tag.go @@ -17,6 +17,7 @@ package spec import ( "github.com/go-openapi/jsonpointer" "github.com/go-openapi/swag" + json "github.com/goccy/go-json" ) // TagProps describe a tag entry in the top level tags section of a swagger spec diff --git a/xml_object_test.go b/xml_object_test.go index de8fa65..0faed0b 100644 --- a/xml_object_test.go +++ b/xml_object_test.go @@ -17,6 +17,7 @@ package spec import ( "testing" + json "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" )