summaryrefslogtreecommitdiff
path: root/vendor/github.com/go-openapi/analysis/schema.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/go-openapi/analysis/schema.go')
-rw-r--r--vendor/github.com/go-openapi/analysis/schema.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/vendor/github.com/go-openapi/analysis/schema.go b/vendor/github.com/go-openapi/analysis/schema.go
index fc055095c..ab190db5b 100644
--- a/vendor/github.com/go-openapi/analysis/schema.go
+++ b/vendor/github.com/go-openapi/analysis/schema.go
@@ -1,7 +1,7 @@
package analysis
import (
- "fmt"
+ "errors"
"github.com/go-openapi/spec"
"github.com/go-openapi/strfmt"
@@ -19,7 +19,7 @@ type SchemaOpts struct {
// patterns.
func Schema(opts SchemaOpts) (*AnalyzedSchema, error) {
if opts.Schema == nil {
- return nil, fmt.Errorf("no schema to analyze")
+ return nil, errors.New("no schema to analyze")
}
a := &AnalyzedSchema{
@@ -247,10 +247,10 @@ func (a *AnalyzedSchema) isArrayType() bool {
// isAnalyzedAsComplex determines if an analyzed schema is eligible to flattening (i.e. it is "complex").
//
// Complex means the schema is any of:
-// - a simple type (primitive)
-// - an array of something (items are possibly complex ; if this is the case, items will generate a definition)
-// - a map of something (additionalProperties are possibly complex ; if this is the case, additionalProperties will
-// generate a definition)
+// - a simple type (primitive)
+// - an array of something (items are possibly complex ; if this is the case, items will generate a definition)
+// - a map of something (additionalProperties are possibly complex ; if this is the case, additionalProperties will
+// generate a definition)
func (a *AnalyzedSchema) isAnalyzedAsComplex() bool {
return !a.IsSimpleSchema && !a.IsArray && !a.IsMap
}