Bump go-openapi dependencies to preferred version
Signed-off-by: He Xiaoxi <xxhe@alauda.io>
This commit is contained in:
2
vendor/github.com/go-openapi/analysis/.golangci.yml
generated
vendored
2
vendor/github.com/go-openapi/analysis/.golangci.yml
generated
vendored
@@ -17,3 +17,5 @@ linters:
|
||||
enable-all: true
|
||||
disable:
|
||||
- maligned
|
||||
- gochecknoglobals
|
||||
- gochecknoinits
|
||||
|
19
vendor/github.com/go-openapi/analysis/.travis.yml
generated
vendored
19
vendor/github.com/go-openapi/analysis/.travis.yml
generated
vendored
@@ -1,24 +1,15 @@
|
||||
after_success:
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
go:
|
||||
- '1.9'
|
||||
- 1.10.x
|
||||
- 1.11.x
|
||||
- 1.12.x
|
||||
install:
|
||||
- go get -u github.com/axw/gocov/gocov
|
||||
- go get -u gopkg.in/matm/v1/gocov-html
|
||||
- go get -u github.com/cee-dub/go-junit-report
|
||||
- go get -u github.com/docker/go-units
|
||||
- go get -u github.com/stretchr/testify/assert
|
||||
- go get -u gopkg.in/yaml.v2
|
||||
- go get -u github.com/go-openapi/swag
|
||||
- go get -u github.com/go-openapi/jsonpointer
|
||||
- go get -u github.com/go-openapi/spec
|
||||
- go get -u github.com/go-openapi/strfmt
|
||||
- go get -u github.com/go-openapi/loads/fmts
|
||||
- GO111MODULE=off go get -u gotest.tools/gotestsum
|
||||
env:
|
||||
- GO111MODULE=on
|
||||
language: go
|
||||
notifications:
|
||||
slack:
|
||||
secure: Sf7kZf7ZGbnwWUMpffHwMu5A0cHkLK2MYY32LNTPj4+/3qC3Ghl7+9v4TSLOqOlCwdRNjOGblAq7s+GDJed6/xgRQl1JtCi1klzZNrYX4q01pgTPvvGcwbBkIYgeMaPeIRcK9OZnud7sRXdttozgTOpytps2U6Js32ip7uj5mHSg2ub0FwoSJwlS6dbezZ8+eDhoha0F/guY99BEwx8Bd+zROrT2TFGsSGOFGN6wFc7moCqTHO/YkWib13a2QNXqOxCCVBy/lt76Wp+JkeFppjHlzs/2lP3EAk13RIUAaesdEUHvIHrzCyNJEd3/+KO2DzsWOYfpktd+KBCvgaYOsoo7ubdT3IROeAegZdCgo/6xgCEsmFc9ZcqCfN5yNx2A+BZ2Vwmpws+bQ1E1+B5HDzzaiLcYfG4X2O210QVGVDLWsv1jqD+uPYeHY2WRfh5ZsIUFvaqgUEnwHwrK44/8REAhQavt1QAj5uJpsRd7CkRVPWRNK+yIky+wgbVUFEchRNmS55E7QWf+W4+4QZkQi7vUTMc9nbTUu2Es9NfvfudOpM2wZbn98fjpb/qq/nRv6Bk+ca+7XD5/IgNLMbWp2ouDdzbiHLCOfDUiHiDJhLfFZx9Bwo7ZwfzeOlbrQX66bx7xRKYmOe4DLrXhNcpbsMa8qbfxlZRCmYbubB/Y8h4=
|
||||
script:
|
||||
- hack/coverage
|
||||
- gotestsum -f short-verbose -- -race -timeout=20m -coverprofile=coverage.txt -covermode=atomic ./...
|
||||
|
104
vendor/github.com/go-openapi/analysis/analyzer.go
generated
vendored
104
vendor/github.com/go-openapi/analysis/analyzer.go
generated
vendored
@@ -104,6 +104,38 @@ func (p *patternAnalysis) addSchemaPattern(key, pattern string) {
|
||||
p.addPattern(key, pattern)
|
||||
}
|
||||
|
||||
type enumAnalysis struct {
|
||||
parameters map[string][]interface{}
|
||||
headers map[string][]interface{}
|
||||
items map[string][]interface{}
|
||||
schemas map[string][]interface{}
|
||||
allEnums map[string][]interface{}
|
||||
}
|
||||
|
||||
func (p *enumAnalysis) addEnum(key string, enum []interface{}) {
|
||||
p.allEnums["#"+key] = enum
|
||||
}
|
||||
|
||||
func (p *enumAnalysis) addParameterEnum(key string, enum []interface{}) {
|
||||
p.parameters["#"+key] = enum
|
||||
p.addEnum(key, enum)
|
||||
}
|
||||
|
||||
func (p *enumAnalysis) addHeaderEnum(key string, enum []interface{}) {
|
||||
p.headers["#"+key] = enum
|
||||
p.addEnum(key, enum)
|
||||
}
|
||||
|
||||
func (p *enumAnalysis) addItemsEnum(key string, enum []interface{}) {
|
||||
p.items["#"+key] = enum
|
||||
p.addEnum(key, enum)
|
||||
}
|
||||
|
||||
func (p *enumAnalysis) addSchemaEnum(key string, enum []interface{}) {
|
||||
p.schemas["#"+key] = enum
|
||||
p.addEnum(key, enum)
|
||||
}
|
||||
|
||||
// New takes a swagger spec object and returns an analyzed spec document.
|
||||
// The analyzed document contains a number of indices that make it easier to
|
||||
// reason about semantics of a swagger specification for use in code generation
|
||||
@@ -134,6 +166,13 @@ func New(doc *spec.Swagger) *Spec {
|
||||
schemas: make(map[string]string, 150),
|
||||
allPatterns: make(map[string]string, 150),
|
||||
},
|
||||
enums: enumAnalysis{
|
||||
parameters: make(map[string][]interface{}, 150),
|
||||
headers: make(map[string][]interface{}, 150),
|
||||
items: make(map[string][]interface{}, 150),
|
||||
schemas: make(map[string][]interface{}, 150),
|
||||
allEnums: make(map[string][]interface{}, 150),
|
||||
},
|
||||
}
|
||||
a.initialize()
|
||||
return a
|
||||
@@ -149,6 +188,7 @@ type Spec struct {
|
||||
operations map[string]map[string]*spec.Operation
|
||||
references referenceAnalysis
|
||||
patterns patternAnalysis
|
||||
enums enumAnalysis
|
||||
allSchemas map[string]SchemaRef
|
||||
allOfs map[string]SchemaRef
|
||||
}
|
||||
@@ -173,6 +213,11 @@ func (s *Spec) reset() {
|
||||
s.patterns.items = make(map[string]string, 150)
|
||||
s.patterns.schemas = make(map[string]string, 150)
|
||||
s.patterns.allPatterns = make(map[string]string, 150)
|
||||
s.enums.parameters = make(map[string][]interface{}, 150)
|
||||
s.enums.headers = make(map[string][]interface{}, 150)
|
||||
s.enums.items = make(map[string][]interface{}, 150)
|
||||
s.enums.schemas = make(map[string][]interface{}, 150)
|
||||
s.enums.allEnums = make(map[string][]interface{}, 150)
|
||||
}
|
||||
|
||||
func (s *Spec) reload() {
|
||||
@@ -207,6 +252,9 @@ func (s *Spec) initialize() {
|
||||
if parameter.Pattern != "" {
|
||||
s.patterns.addParameterPattern(refPref, parameter.Pattern)
|
||||
}
|
||||
if len(parameter.Enum) > 0 {
|
||||
s.enums.addParameterEnum(refPref, parameter.Enum)
|
||||
}
|
||||
}
|
||||
|
||||
for name, response := range s.spec.Responses {
|
||||
@@ -219,6 +267,9 @@ func (s *Spec) initialize() {
|
||||
if v.Pattern != "" {
|
||||
s.patterns.addHeaderPattern(hRefPref, v.Pattern)
|
||||
}
|
||||
if len(v.Enum) > 0 {
|
||||
s.enums.addHeaderEnum(hRefPref, v.Enum)
|
||||
}
|
||||
}
|
||||
if response.Schema != nil {
|
||||
s.analyzeSchema("schema", *response.Schema, refPref)
|
||||
@@ -256,6 +307,9 @@ func (s *Spec) analyzeOperations(path string, pi *spec.PathItem) {
|
||||
if param.Pattern != "" {
|
||||
s.patterns.addParameterPattern(refPref, param.Pattern)
|
||||
}
|
||||
if len(param.Enum) > 0 {
|
||||
s.enums.addParameterEnum(refPref, param.Enum)
|
||||
}
|
||||
if param.Items != nil {
|
||||
s.analyzeItems("items", param.Items, refPref, "parameter")
|
||||
}
|
||||
@@ -277,6 +331,9 @@ func (s *Spec) analyzeItems(name string, items *spec.Items, prefix, location str
|
||||
if items.Pattern != "" {
|
||||
s.patterns.addItemsPattern(refPref, items.Pattern)
|
||||
}
|
||||
if len(items.Enum) > 0 {
|
||||
s.enums.addItemsEnum(refPref, items.Enum)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Spec) analyzeOperation(method, path string, op *spec.Operation) {
|
||||
@@ -308,6 +365,9 @@ func (s *Spec) analyzeOperation(method, path string, op *spec.Operation) {
|
||||
if param.Pattern != "" {
|
||||
s.patterns.addParameterPattern(refPref, param.Pattern)
|
||||
}
|
||||
if len(param.Enum) > 0 {
|
||||
s.enums.addParameterEnum(refPref, param.Enum)
|
||||
}
|
||||
s.analyzeItems("items", param.Items, refPref, "parameter")
|
||||
if param.In == "body" && param.Schema != nil {
|
||||
s.analyzeSchema("schema", *param.Schema, refPref)
|
||||
@@ -341,6 +401,9 @@ func (s *Spec) analyzeOperation(method, path string, op *spec.Operation) {
|
||||
if v.Pattern != "" {
|
||||
s.patterns.addHeaderPattern(hRefPref, v.Pattern)
|
||||
}
|
||||
if len(v.Enum) > 0 {
|
||||
s.enums.addHeaderEnum(hRefPref, v.Enum)
|
||||
}
|
||||
}
|
||||
if res.Schema != nil {
|
||||
s.analyzeSchema("schema", *res.Schema, refPref)
|
||||
@@ -366,6 +429,9 @@ func (s *Spec) analyzeSchema(name string, schema spec.Schema, prefix string) {
|
||||
if schema.Pattern != "" {
|
||||
s.patterns.addSchemaPattern(refURI, schema.Pattern)
|
||||
}
|
||||
if len(schema.Enum) > 0 {
|
||||
s.enums.addSchemaEnum(refURI, schema.Enum)
|
||||
}
|
||||
|
||||
for k, v := range schema.Definitions {
|
||||
s.analyzeSchema(k, v, slashpath.Join(refURI, "definitions"))
|
||||
@@ -861,6 +927,14 @@ func cloneStringMap(source map[string]string) map[string]string {
|
||||
return res
|
||||
}
|
||||
|
||||
func cloneEnumMap(source map[string][]interface{}) map[string][]interface{} {
|
||||
res := make(map[string][]interface{}, len(source))
|
||||
for k, v := range source {
|
||||
res[k] = v
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
// ParameterPatterns returns all the patterns found in parameters
|
||||
// the map is cloned to avoid accidental changes
|
||||
func (s *Spec) ParameterPatterns() map[string]string {
|
||||
@@ -890,3 +964,33 @@ func (s *Spec) SchemaPatterns() map[string]string {
|
||||
func (s *Spec) AllPatterns() map[string]string {
|
||||
return cloneStringMap(s.patterns.allPatterns)
|
||||
}
|
||||
|
||||
// ParameterEnums returns all the enums found in parameters
|
||||
// the map is cloned to avoid accidental changes
|
||||
func (s *Spec) ParameterEnums() map[string][]interface{} {
|
||||
return cloneEnumMap(s.enums.parameters)
|
||||
}
|
||||
|
||||
// HeaderEnums returns all the enums found in response headers
|
||||
// the map is cloned to avoid accidental changes
|
||||
func (s *Spec) HeaderEnums() map[string][]interface{} {
|
||||
return cloneEnumMap(s.enums.headers)
|
||||
}
|
||||
|
||||
// ItemsEnums returns all the enums found in simple array items
|
||||
// the map is cloned to avoid accidental changes
|
||||
func (s *Spec) ItemsEnums() map[string][]interface{} {
|
||||
return cloneEnumMap(s.enums.items)
|
||||
}
|
||||
|
||||
// SchemaEnums returns all the enums found in schemas
|
||||
// the map is cloned to avoid accidental changes
|
||||
func (s *Spec) SchemaEnums() map[string][]interface{} {
|
||||
return cloneEnumMap(s.enums.schemas)
|
||||
}
|
||||
|
||||
// AllEnums returns all the enums found in the spec
|
||||
// the map is cloned to avoid accidental changes
|
||||
func (s *Spec) AllEnums() map[string][]interface{} {
|
||||
return cloneEnumMap(s.enums.allEnums)
|
||||
}
|
||||
|
127
vendor/github.com/go-openapi/analysis/flatten.go
generated
vendored
127
vendor/github.com/go-openapi/analysis/flatten.go
generated
vendored
@@ -75,12 +75,14 @@ type newRef struct {
|
||||
type context struct {
|
||||
newRefs map[string]*newRef
|
||||
warnings []string
|
||||
resolved map[string]string
|
||||
}
|
||||
|
||||
func newContext() *context {
|
||||
return &context{
|
||||
newRefs: make(map[string]*newRef, 150),
|
||||
warnings: make([]string, 0),
|
||||
resolved: make(map[string]string, 50),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,8 +143,9 @@ func Flatten(opts FlattenOpts) error {
|
||||
|
||||
opts.flattenContext = newContext()
|
||||
|
||||
// recursively expand responses, parameters, path items and items in simple schemas
|
||||
// TODO: we should not expand discriminated types
|
||||
// recursively expand responses, parameters, path items and items in simple schemas.
|
||||
// This simplifies the spec and leaves $ref only into schema objects.
|
||||
//
|
||||
if err := swspec.ExpandSpec(opts.Swagger(), opts.ExpandOpts(!opts.Expand)); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -163,10 +166,13 @@ func Flatten(opts FlattenOpts) error {
|
||||
opts.Spec.reload() // re-analyze
|
||||
|
||||
// at this point there are no other references left but schemas
|
||||
if err := importExternalReferences(&opts); err != nil {
|
||||
return err
|
||||
for imported := false; !imported; {
|
||||
var err error
|
||||
if imported, err = importExternalReferences(&opts); err != nil {
|
||||
return err
|
||||
}
|
||||
opts.Spec.reload() // re-analyze
|
||||
}
|
||||
opts.Spec.reload() // re-analyze
|
||||
|
||||
if !opts.Minimal && !opts.Expand {
|
||||
// full flattening: rewrite inline schemas (schemas that aren't simple types or arrays or maps)
|
||||
@@ -176,7 +182,6 @@ func Flatten(opts FlattenOpts) error {
|
||||
|
||||
opts.Spec.reload() // re-analyze
|
||||
}
|
||||
|
||||
// rewrite JSON pointers other than $ref to named definitions
|
||||
// and attempts to resolve conflicting names
|
||||
if err := stripPointersAndOAIGen(&opts); err != nil {
|
||||
@@ -512,7 +517,10 @@ const (
|
||||
definitionsPath = "#/definitions"
|
||||
)
|
||||
|
||||
var ignoredKeys map[string]struct{}
|
||||
var (
|
||||
ignoredKeys map[string]struct{}
|
||||
validMethods map[string]struct{}
|
||||
)
|
||||
|
||||
func init() {
|
||||
ignoredKeys = map[string]struct{}{
|
||||
@@ -522,6 +530,16 @@ func init() {
|
||||
"anyOf": {},
|
||||
"oneOf": {},
|
||||
}
|
||||
|
||||
validMethods = map[string]struct{}{
|
||||
"GET": {},
|
||||
"HEAD": {},
|
||||
"OPTIONS": {},
|
||||
"PATCH": {},
|
||||
"POST": {},
|
||||
"PUT": {},
|
||||
"DELETE": {},
|
||||
}
|
||||
}
|
||||
|
||||
type splitKey []string
|
||||
@@ -619,26 +637,12 @@ func (s splitKey) ResponseName() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
var validMethods map[string]struct{}
|
||||
|
||||
func init() {
|
||||
validMethods = map[string]struct{}{
|
||||
"GET": {},
|
||||
"HEAD": {},
|
||||
"OPTIONS": {},
|
||||
"PATCH": {},
|
||||
"POST": {},
|
||||
"PUT": {},
|
||||
"DELETE": {},
|
||||
}
|
||||
}
|
||||
|
||||
func (s splitKey) PathItemRef() swspec.Ref {
|
||||
if len(s) < 3 {
|
||||
return swspec.Ref{}
|
||||
}
|
||||
pth, method := s[1], s[2]
|
||||
if _, validMethod := validMethods[strings.ToUpper(method)]; !validMethod && !strings.HasPrefix(method, "x-") {
|
||||
if _, isValidMethod := validMethods[strings.ToUpper(method)]; !isValidMethod && !strings.HasPrefix(method, "x-") {
|
||||
return swspec.Ref{}
|
||||
}
|
||||
return swspec.MustCreateRef("#" + slashpath.Join("/", paths, jsonpointer.Escape(pth), strings.ToUpper(method)))
|
||||
@@ -777,9 +781,12 @@ func cloneSchema(schema *swspec.Schema) (*swspec.Schema, error) {
|
||||
return &sch, nil
|
||||
}
|
||||
|
||||
func importExternalReferences(opts *FlattenOpts) error {
|
||||
func importExternalReferences(opts *FlattenOpts) (bool, error) {
|
||||
groupedRefs := reverseIndexForSchemaRefs(opts)
|
||||
sortedRefStr := make([]string, 0, len(groupedRefs))
|
||||
if opts.flattenContext == nil {
|
||||
opts.flattenContext = newContext()
|
||||
}
|
||||
|
||||
// sort $ref resolution to ensure deterministic name conflict resolution
|
||||
for refStr := range groupedRefs {
|
||||
@@ -787,35 +794,53 @@ func importExternalReferences(opts *FlattenOpts) error {
|
||||
}
|
||||
sort.Strings(sortedRefStr)
|
||||
|
||||
complete := true
|
||||
for _, refStr := range sortedRefStr {
|
||||
entry := groupedRefs[refStr]
|
||||
if !entry.Ref.HasFragmentOnly {
|
||||
debugLog("importing external schema for [%s] from %s", strings.Join(entry.Keys, ", "), refStr)
|
||||
// resolve to actual schema
|
||||
sch := new(swspec.Schema)
|
||||
sch.Ref = entry.Ref
|
||||
if err := swspec.ExpandSchemaWithBasePath(sch, nil, opts.ExpandOpts(false)); err != nil {
|
||||
return err
|
||||
}
|
||||
if sch == nil {
|
||||
return fmt.Errorf("no schema found at %s for [%s]", refStr, strings.Join(entry.Keys, ", "))
|
||||
}
|
||||
debugLog("importing external schema for [%s] from %s", strings.Join(entry.Keys, ", "), refStr)
|
||||
complete = false
|
||||
var isOAIGen bool
|
||||
|
||||
// generate a unique name - isOAIGen means that a naming conflict was resolved by changing the name
|
||||
newName, isOAIGen := uniqifyName(opts.Swagger().Definitions, nameFromRef(entry.Ref))
|
||||
debugLog("new name for [%s]: %s - with name conflict:%t",
|
||||
strings.Join(entry.Keys, ", "), newName, isOAIGen)
|
||||
|
||||
// rewrite the external refs to local ones
|
||||
for _, key := range entry.Keys {
|
||||
if err := updateRef(opts.Swagger(), key,
|
||||
swspec.MustCreateRef(slashpath.Join(definitionsPath, newName))); err != nil {
|
||||
return err
|
||||
newName := opts.flattenContext.resolved[refStr]
|
||||
if newName != "" {
|
||||
// rewrite ref with already resolved external ref (useful for cyclicali refs)
|
||||
debugLog("resolving known ref [%s] to %s", refStr, newName)
|
||||
// rewrite the external refs to local ones
|
||||
for _, key := range entry.Keys {
|
||||
if err := updateRef(opts.Swagger(), key,
|
||||
swspec.MustCreateRef(slashpath.Join(definitionsPath, newName))); err != nil {
|
||||
return false, err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
debugLog("importing external schema for [%s] from %s", strings.Join(entry.Keys, ", "), refStr)
|
||||
|
||||
// keep track of created refs
|
||||
if opts.flattenContext != nil {
|
||||
// resolve to actual schema
|
||||
sch := new(swspec.Schema)
|
||||
sch.Ref = entry.Ref
|
||||
if err := swspec.ExpandSchemaWithBasePath(sch, nil, opts.ExpandOpts(false)); err != nil {
|
||||
return false, err
|
||||
}
|
||||
if sch == nil {
|
||||
return false, fmt.Errorf("no schema found at %s for [%s]", refStr, strings.Join(entry.Keys, ", "))
|
||||
}
|
||||
debugLog("importing external schema for [%s] from %s", strings.Join(entry.Keys, ", "), refStr)
|
||||
|
||||
// generate a unique name - isOAIGen means that a naming conflict was resolved by changing the name
|
||||
newName, isOAIGen = uniqifyName(opts.Swagger().Definitions, nameFromRef(entry.Ref))
|
||||
debugLog("new name for [%s]: %s - with name conflict:%t",
|
||||
strings.Join(entry.Keys, ", "), newName, isOAIGen)
|
||||
|
||||
opts.flattenContext.resolved[refStr] = newName
|
||||
|
||||
// rewrite the external refs to local ones
|
||||
for _, key := range entry.Keys {
|
||||
if err := updateRef(opts.Swagger(), key,
|
||||
swspec.MustCreateRef(slashpath.Join(definitionsPath, newName))); err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
// keep track of created refs
|
||||
resolved := false
|
||||
if _, ok := opts.flattenContext.newRefs[key]; ok {
|
||||
resolved = opts.flattenContext.newRefs[key].resolved
|
||||
@@ -829,13 +854,13 @@ func importExternalReferences(opts *FlattenOpts) error {
|
||||
schema: sch,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// add the resolved schema to the definitions
|
||||
saveSchema(opts.Swagger(), newName, sch)
|
||||
// add the resolved schema to the definitions
|
||||
saveSchema(opts.Swagger(), newName, sch)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
return complete, nil
|
||||
}
|
||||
|
||||
type refRevIdx struct {
|
||||
@@ -1259,7 +1284,6 @@ func croak(opts *FlattenOpts) {
|
||||
func namePointers(opts *FlattenOpts) error {
|
||||
debugLog("name pointers")
|
||||
refsToReplace := make(map[string]SchemaRef, len(opts.Spec.references.schemas))
|
||||
//for k, ref := range opts.Spec.references.schemas {
|
||||
for k, ref := range opts.Spec.references.allRefs {
|
||||
if slashpath.Dir(ref.String()) == definitionsPath {
|
||||
// this a ref to a top-level definition: ok
|
||||
@@ -1377,6 +1401,7 @@ func namePointers(opts *FlattenOpts) error {
|
||||
// NOTE: all external $ref's are assumed to be already expanded at this stage.
|
||||
func deepestRef(opts *FlattenOpts, ref swspec.Ref) (swspec.Ref, *swspec.Schema, error) {
|
||||
if !ref.HasFragmentOnly {
|
||||
// we found an external $ref, which is odd
|
||||
// does nothing on external $refs
|
||||
return ref, nil, nil
|
||||
}
|
||||
|
15
vendor/github.com/go-openapi/analysis/go.mod
generated
vendored
15
vendor/github.com/go-openapi/analysis/go.mod
generated
vendored
@@ -1,10 +1,13 @@
|
||||
module github.com/go-openapi/analysis
|
||||
|
||||
require (
|
||||
github.com/go-openapi/jsonpointer v0.17.0
|
||||
github.com/go-openapi/loads v0.17.0
|
||||
github.com/go-openapi/spec v0.17.0
|
||||
github.com/go-openapi/strfmt v0.17.0
|
||||
github.com/go-openapi/swag v0.17.0
|
||||
github.com/stretchr/testify v1.2.2
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
|
||||
github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 // indirect
|
||||
github.com/go-openapi/errors v0.19.2 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.19.2
|
||||
github.com/go-openapi/loads v0.19.0
|
||||
github.com/go-openapi/spec v0.19.2
|
||||
github.com/go-openapi/strfmt v0.19.0
|
||||
github.com/go-openapi/swag v0.19.2
|
||||
github.com/stretchr/testify v1.3.0
|
||||
)
|
||||
|
82
vendor/github.com/go-openapi/analysis/go.sum
generated
vendored
82
vendor/github.com/go-openapi/analysis/go.sum
generated
vendored
@@ -1,37 +1,79 @@
|
||||
github.com/PuerkitoBio/purell v1.1.0 h1:rmGxhojJlM0tuKtfdvliR84CFHljx9ag64t2xmVkjK4=
|
||||
github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
|
||||
github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
|
||||
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
|
||||
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
|
||||
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
|
||||
github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf h1:eg0MeVzsP1G42dRafH3vf+al2vQIJU0YHX+1Tw87oco=
|
||||
github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
|
||||
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/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb h1:D4uzjWwKYQ5XnAvUbuvHW93esHg7F8N/OYeBBcJoTr0=
|
||||
github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q=
|
||||
github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 h1:DujepqpGd1hyOd7aW59XpK7Qymp8iy83xq74fLr21is=
|
||||
github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q=
|
||||
github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI=
|
||||
github.com/go-openapi/errors v0.17.0 h1:47T+LqPrQUxFXQnB22aLBfsTRFSqWp5y4OiFgQm+/Lw=
|
||||
github.com/go-openapi/errors v0.17.0/go.mod h1:La0D2x9HoXenv7MDEiAv6vWoe84CXFo0PQRk/jdQlww=
|
||||
github.com/go-openapi/jsonpointer v0.17.0 h1:Bpl2DtZ6k7wKqfFs7e+4P08+M9I3FQgn09a1UsRUQbk=
|
||||
github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0=
|
||||
github.com/go-openapi/jsonreference v0.17.0 h1:d/o7/fsLWWQZACbihvZxcyLQ59jfUVs7WOJv/ak7T7A=
|
||||
github.com/go-openapi/jsonreference v0.17.0/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg=
|
||||
github.com/go-openapi/loads v0.17.0 h1:H22nMs3GDQk4SwAaFQ+jLNw+0xoFeCueawhZlv8MBYs=
|
||||
github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU=
|
||||
github.com/go-openapi/spec v0.17.0 h1:MM5YaXBdBOEcjGHW5WayrAY5Ze2ydNyy71JHeTi7xUc=
|
||||
github.com/go-openapi/spec v0.17.0/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc=
|
||||
github.com/go-openapi/strfmt v0.17.0 h1:79+bCyGHowS3rkr6z8RcG5jVzdKpeKXlDuW6yqE50TM=
|
||||
github.com/go-openapi/strfmt v0.17.0/go.mod h1:/bCWipNKhC9QMhD8HRe2EGbU8G0D4Yvh0G6X4k1Xwvg=
|
||||
github.com/go-openapi/swag v0.17.0 h1:7wu+dZ5k83kvUWeAb+WUkFiUhDzwGqzTR/NhWzeo1JU=
|
||||
github.com/go-openapi/swag v0.17.0/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I=
|
||||
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 h1:2gxZ0XQIU/5z3Z3bUBu+FXuk2pFbkN6tcwi/pjyaDic=
|
||||
github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0=
|
||||
github.com/go-openapi/errors v0.19.2 h1:a2kIyV3w+OS3S97zxUndRVD46+FhGOUBDFY7nmu4CsY=
|
||||
github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94=
|
||||
github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M=
|
||||
github.com/go-openapi/jsonpointer v0.19.2 h1:A9+F4Dc/MCNB5jibxf6rRvOvR/iFgQdyNx9eIhnGqq0=
|
||||
github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg=
|
||||
github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I=
|
||||
github.com/go-openapi/jsonreference v0.19.2 h1:o20suLFB4Ri0tuzpWtyHlh7E7HnkqTNLq6aR6WVNS1w=
|
||||
github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc=
|
||||
github.com/go-openapi/loads v0.19.0 h1:wCOBNscACI8L93tt5tvB2zOMkJ098XCw3fP0BY2ybDA=
|
||||
github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU=
|
||||
github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI=
|
||||
github.com/go-openapi/spec v0.19.2 h1:SStNd1jRcYtfKCN7R0laGNs80WYYvn5CbBjM2sOmCrE=
|
||||
github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY=
|
||||
github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU=
|
||||
github.com/go-openapi/strfmt v0.19.0 h1:0Dn9qy1G9+UJfRU7TR8bmdGxb4uifB7HNrJjOnV0yPk=
|
||||
github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY=
|
||||
github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg=
|
||||
github.com/go-openapi/swag v0.19.2 h1:jvO6bCMBEilGwMfHhrd61zIID4oIFdwb76V17SM88dE=
|
||||
github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
|
||||
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
|
||||
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
|
||||
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63 h1:nTT4s92Dgz2HlrB2NaMgvlfqHH39OgMhA7z3PK7PGD4=
|
||||
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||
github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
|
||||
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
|
||||
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/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
golang.org/x/net v0.0.0-20181005035420-146acd28ed58 h1:otZG8yDCO4LVps5+9bxOeNiCvgmOyt96J3roHTYs7oE=
|
||||
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 h1:dfGZHvZk057jK2MCeWus/TowKpJ8y4AmooUzdBSR9GU=
|
||||
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
|
6
vendor/github.com/go-openapi/analysis/schema.go
generated
vendored
6
vendor/github.com/go-openapi/analysis/schema.go
generated
vendored
@@ -1,6 +1,8 @@
|
||||
package analysis
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/spec"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
@@ -16,6 +18,10 @@ type SchemaOpts struct {
|
||||
// Schema analysis, will classify the schema according to known
|
||||
// patterns.
|
||||
func Schema(opts SchemaOpts) (*AnalyzedSchema, error) {
|
||||
if opts.Schema == nil {
|
||||
return nil, fmt.Errorf("no schema to analyze")
|
||||
}
|
||||
|
||||
a := &AnalyzedSchema{
|
||||
schema: opts.Schema,
|
||||
root: opts.Root,
|
||||
|
Reference in New Issue
Block a user