-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into as/reqd-tests
- Loading branch information
Showing
19 changed files
with
265 additions
and
350 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package oas | ||
|
||
import ( | ||
"github.com/getkin/kin-openapi/openapi3" | ||
|
||
openapifork "github.com/TykTechnologies/kin-openapi/openapi3" | ||
) | ||
|
||
type OldOAS struct { | ||
openapifork.T | ||
} | ||
|
||
// ConvertToNewerOAS converts a deprecated OldOAS object to the newer OAS representation. | ||
func (o *OldOAS) ConvertToNewerOAS() (*OAS, error) { | ||
outBytes, err := o.MarshalJSON() | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
loader := openapi3.NewLoader() | ||
t, err := loader.LoadFromData(outBytes) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return &OAS{T: *t}, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.