Update a few dependencies
github.com/go-openapi/* github.com/asaskevich/govalidator
This commit is contained in:
12
vendor/github.com/go-openapi/spec/items.go
generated
vendored
12
vendor/github.com/go-openapi/spec/items.go
generated
vendored
@@ -22,6 +22,7 @@ import (
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// SimpleSchema describe swagger simple schemas for parameters and headers
|
||||
type SimpleSchema struct {
|
||||
Type string `json:"type,omitempty"`
|
||||
Format string `json:"format,omitempty"`
|
||||
@@ -31,6 +32,7 @@ type SimpleSchema struct {
|
||||
Example interface{} `json:"example,omitempty"`
|
||||
}
|
||||
|
||||
// TypeName return the type (or format) of a simple schema
|
||||
func (s *SimpleSchema) TypeName() string {
|
||||
if s.Format != "" {
|
||||
return s.Format
|
||||
@@ -38,6 +40,7 @@ func (s *SimpleSchema) TypeName() string {
|
||||
return s.Type
|
||||
}
|
||||
|
||||
// ItemsTypeName yields the type of items in a simple schema array
|
||||
func (s *SimpleSchema) ItemsTypeName() string {
|
||||
if s.Items == nil {
|
||||
return ""
|
||||
@@ -45,6 +48,7 @@ func (s *SimpleSchema) ItemsTypeName() string {
|
||||
return s.Items.TypeName()
|
||||
}
|
||||
|
||||
// CommonValidations describe common JSON-schema validations
|
||||
type CommonValidations struct {
|
||||
Maximum *float64 `json:"maximum,omitempty"`
|
||||
ExclusiveMaximum bool `json:"exclusiveMaximum,omitempty"`
|
||||
@@ -212,18 +216,18 @@ func (i Items) MarshalJSON() ([]byte, error) {
|
||||
}
|
||||
|
||||
// JSONLookup look up a value by the json property name
|
||||
func (p Items) JSONLookup(token string) (interface{}, error) {
|
||||
func (i Items) JSONLookup(token string) (interface{}, error) {
|
||||
if token == "$ref" {
|
||||
return &p.Ref, nil
|
||||
return &i.Ref, nil
|
||||
}
|
||||
|
||||
r, _, err := jsonpointer.GetForToken(p.CommonValidations, token)
|
||||
r, _, err := jsonpointer.GetForToken(i.CommonValidations, token)
|
||||
if err != nil && !strings.HasPrefix(err.Error(), "object has no field") {
|
||||
return nil, err
|
||||
}
|
||||
if r != nil {
|
||||
return r, nil
|
||||
}
|
||||
r, _, err = jsonpointer.GetForToken(p.SimpleSchema, token)
|
||||
r, _, err = jsonpointer.GetForToken(i.SimpleSchema, token)
|
||||
return r, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user