func (a *ArrayItem) UnmarshalYAML(um func(interface{}) error) error {
	var y struct {
		ArrayFields `yaml:",inline"`
		Items map[string]interface{}
	}
	if err := um(&y); err != nil {
		return err
	}
	a.ArrayFields = y.ArrayFields
	var err error
	a.Items, err = unmarshalItems(y.Items)
	return err
}
UnmarshalYAML unmarshals an ArrayItem from YAML or JSON.
package v2
import (
	"errors"
	"net/url"
	"github.com/go-yaml/yaml"
)
type Document struct {
	Version string  
	Info    *Info   
	Host     *string
	BasePath *string `yaml:"basePath"`
	Schemes  []string
	Consumes []string
	Produces []string
	Paths map[string]PathItem  
	Definitions *SchemaMap
	Parameters  *ParameterMap
	Responses   *map[string]Response
	SecurityDefinitions *SecuritySchemeMap `yaml:"securityDefinitions"`
	Security            []map[string][]string
	Tags          []Tag
	Documentation *ExternalDocumentation
}
type Info struct {
	Title       string  
	Description *string
	TermsOfService *string
	Contact        *Contact
	License        *License
	Version string  
}
type Contact struct {
	Name  *string
	URL   *url.URL
	Email *string
}
type License struct {
	Name string  
	URL  *url.URL
}
type PathItem struct {
	Reference *string
	Get     *Operation
	Put     *Operation
	Post    *Operation
	Delete  *Operation
	Options *Operation
	Head    *Operation
	Patch   *Operation
	Parameters Parameters
}
type Operation struct {
	Tags []string
	Summary       *string
	Description   *string
	Documentation *ExternalDocumentation
	OperationID *string
	Consumes []string
	Produces []string
	Parameters Parameters
	Responses  *Responses  
	Schemes []string
	Deprecated bool
	Security []map[string][]string
}
type ExternalDocumentation struct {
	Description *string
	URL         *url.URL  
}
type Parameters []Parameter
func (p *Parameters) UnmarshalYAML(um func(interface{}) error) error {
	var ys []map[string]interface{}
	if err := um(&ys); err != nil {
		return err
	}
	*p = make(Parameters, len(ys))
	var err error
	for i, y := range ys {
		if (*p)[i], err = unmarshalParameter(y); err != nil {
			return err
		}
	}
	return nil
}
type ParameterMap map[string]Parameter
func (p *ParameterMap) UnmarshalYAML(um func(interface{}) error) error {
	var ys map[string]map[string]interface{}
	if err := um(&ys); err != nil {
		return err
	}
	*p = make(map[string]Parameter, len(ys))
	var err error
	for k, y := range ys {
		if (*p)[k], err = unmarshalParameter(y); err != nil {
			return err
		}
	}
	return nil
}
func unmarshalParameter(y map[string]interface{}) (Parameter, error) {
	b, err := yaml.Marshal(&y)
	if err != nil {
		return nil, err
	}
	if _, ok := y["$ref"]; ok {
		var v ReferenceParamter
		err = yaml.Unmarshal(b, &v)
		return &v, err
	} else if y["in"] == "body" {
		var v BodyParameter
		err = yaml.Unmarshal(b, &v)
		return &v, err
	}
	switch y["type"] {
	case "string":
		var v StringParameter
		err = yaml.Unmarshal(b, &v)
		return &v, err
	case "number":
		var v NumberParameter
		err = yaml.Unmarshal(b, &v)
		return &v, err
	case "integer":
		var v IntegerParameter
		err = yaml.Unmarshal(b, &v)
		return &v, err
	case "boolean":
		var v BooleanParameter
		err = yaml.Unmarshal(b, &v)
		return &v, err
	case "array":
		var p ParameterFields
		if err = yaml.Unmarshal(b, &p); err != nil {
			return nil, err
		}
		v := ArrayParameter{ParameterFields: p}
		err = yaml.Unmarshal(b, &v)
		return &v, err
	case "file":
		var v FileParameter
		err = yaml.Unmarshal(b, &v)
		return &v, err
	default:
		return nil, errors.New("bad parameter type")
	}
}
type Parameter interface {
	GetName() string  
	GetIn() string    
	GetDescription() *string
	IsRequired() bool
}
type ReferenceParamter struct {
	Reference string `yaml:"$ref"`
}
func (ReferenceParamter) GetName() string { return "" }
func (ReferenceParamter) GetIn() string { return "" }
func (ReferenceParamter) GetDescription() *string { return nil }
func (ReferenceParamter) IsRequired() bool { return false }
type ParameterFields struct {
	Name        string  
	In          string  
	Description *string
	Required    bool
}
func (pf *ParameterFields) GetName() string { return pf.Name }
func (pf *ParameterFields) GetIn() string { return pf.In }
func (pf *ParameterFields) GetDescription() *string { return pf.Description }
func (pf *ParameterFields) IsRequired() bool { return pf.Required }
type BodyParameter struct {
	ParameterFields `yaml:",inline"`
	Schema          Schema  
}
func (b *BodyParameter) UnmarshalYAML(um func(interface{}) error) error {
	var y struct {
		ParameterFields `yaml:",inline"`
		Schema          yaml.MapSlice
	}
	if err := um(&y); err != nil {
		return err
	}
	b.ParameterFields = y.ParameterFields
	var err error
	b.Schema, err = unmarshalSchema(y.Schema)
	return err
}
type StringParameter struct {
	ParameterFields `yaml:",inline"`
	StringItem      `yaml:",inline"`
	AllowEmptyValue bool
}
type NumberParameter struct {
	ParameterFields `yaml:",inline"`
	NumberItem      `yaml:",inline"`
	AllowEmptyValue bool
}
type IntegerParameter struct {
	ParameterFields `yaml:",inline"`
	IntegerItem     `yaml:",inline"`
	AllowEmptyValue bool
}
type BooleanParameter struct {
	ParameterFields `yaml:",inline"`
	BooleanItem     `yaml:",inline"`
	AllowEmptyValue bool
}
type ArrayParameter struct {
	ParameterFields `yaml:",inline"`
	ArrayItem       `yaml:",inline"`
	AllowEmptyValue bool
}
type FileParameter struct {
	ParameterFields `yaml:",inline"`
	AllowEmptyValue bool
}
type Items interface {
	Type() string  
}
const (
	stringItem  = "string"
	numberItem  = "number"
	integerItem = "integer"
	booleanItem = "boolean"
	arrayItem   = "array"
)
func unmarshalItems(y map[string]interface{}) (Items, error) {
	b, err := yaml.Marshal(&y)
	if err != nil {
		return nil, err
	}
	switch y["type"] {
	case stringItem:
		var v StringItem
		err := yaml.Unmarshal(b, &v)
		return &v, err
	case numberItem:
		var v NumberItem
		err := yaml.Unmarshal(b, &v)
		return &v, err
	case integerItem:
		var v IntegerItem
		err := yaml.Unmarshal(b, &v)
		return &v, err
	case booleanItem:
		var v BooleanItem
		err := yaml.Unmarshal(b, &v)
		return &v, err
	case arrayItem:
		var v ArrayItem
		err := yaml.Unmarshal(b, &v)
		return &v, err
	default:
		return nil, errors.New("bad schema type: " + y["type"].(string))
	}
}
type StringItem struct {
	Format *string
	Default *string
	Enum    *[]string
	MaxLength *int64
	MinLength *int64
	Pattern   *string
}
func (StringItem) Type() string { return stringItem }
type NumberItem struct {
	Format *string
	Default *float64
	Enum    *[]float64
	Maximum          *float64
	ExclusiveMaximum bool
	Minium           *float64
	ExclusiveMinimum bool
	MultipleOf       *float64
}
func (NumberItem) Type() string { return numberItem }
type IntegerItem struct {
	Format *string
	Default *int64
	Enum    *[]int64
	Maximum          *int64
	ExclusiveMaximum bool
	Minium           *int64
	ExclusiveMinimum bool
	MultipleOf       *int64
}
func (IntegerItem) Type() string { return integerItem }
type BooleanItem struct {
	Default *bool
	Enum    *[]bool
}
func (BooleanItem) Type() string { return booleanItem }
type ArrayFields struct {
	CollectionFormat *string `yaml:"collectionFormat"`
	Default interface{}
	Enum    *[]interface{}
	MaxItems    *uint64
	MinItems    *uint64
	UniqueItems bool
}
type ArrayItem struct {
	ArrayFields `yaml:",inline"`
	Items       Items  
}
func (ArrayItem) Type() string { return arrayItem }