func (r *Result) addPropertySchemata(obj map[string]interface{}, fld string, schema *spec.Schema) {
	if r.fieldSchemata == nil {
		r.fieldSchemata = make([]fieldSchemata, 0, len(obj))
	}
	r.fieldSchemata = append(r.fieldSchemata, fieldSchemata{obj: obj, field: fld, schemata: schemata{one: schema}})
}
addPropertySchemata adds the given schemata for the object and field.
The slice schemata might be reused. I.e. do not modify it after being added to a result.
package validate
import (
	"fmt"
	"reflect"
	"strings"
	"github.com/go-openapi/errors"
	"github.com/go-openapi/spec"
)
type Result struct {
	Errors     []error
	Warnings   []error
	MatchCount int
	data interface{}
	rootObjectSchemata schemata
	fieldSchemata []fieldSchemata
	itemSchemata []itemSchemata
	cachedFieldSchemta map[FieldKey][]*spec.Schema
	cachedItemSchemata map[ItemKey][]*spec.Schema
}
type FieldKey struct {
	object reflect.Value  
	field  string
}
type ItemKey struct {
	slice reflect.Value  
	index int
}
func NewFieldKey(obj map[string]interface{}, field string) FieldKey {
	return FieldKey{object: reflect.ValueOf(obj), field: field}
}
func (fk *FieldKey) Object() map[string]interface{} {
	return fk.object.Interface().(map[string]interface{})
}
func (fk *FieldKey) Field() string {
	return fk.field
}
func NewItemKey(slice interface{}, i int) ItemKey {
	return ItemKey{slice: reflect.ValueOf(slice), index: i}
}
func (ik *ItemKey) Slice() []interface{} {
	return ik.slice.Interface().([]interface{})
}
func (ik *ItemKey) Index() int {
	return ik.index
}
type fieldSchemata struct {
	obj      map[string]interface{}
	field    string
	schemata schemata
}
type itemSchemata struct {
	slice    reflect.Value
	index    int
	schemata schemata
}
func (r *Result) Merge(others ...*Result) *Result {
	for _, other := range others {
		if other == nil {
			continue
		}
		r.mergeWithoutRootSchemata(other)
		r.rootObjectSchemata.Append(other.rootObjectSchemata)
	}
	return r
}
func (r *Result) Data() interface{} {
	return r.data
}
func (r *Result) RootObjectSchemata() []*spec.Schema {
	return r.rootObjectSchemata.Slice()
}
func (r *Result) FieldSchemata() map[FieldKey][]*spec.Schema {
	if r.cachedFieldSchemta != nil {
		return r.cachedFieldSchemta
	}
	ret := make(map[FieldKey][]*spec.Schema, len(r.fieldSchemata))
	for _, fs := range r.fieldSchemata {
		key := NewFieldKey(fs.obj, fs.field)
		if fs.schemata.one != nil {
			ret[key] = append(ret[key], fs.schemata.one)
		} else if len(fs.schemata.multiple) > 0 {
			ret[key] = append(ret[key], fs.schemata.multiple...)
		}
	}
	r.cachedFieldSchemta = ret
	return ret
}
func (r *Result) ItemSchemata() map[ItemKey][]*spec.Schema {
	if r.cachedItemSchemata != nil {
		return r.cachedItemSchemata
	}
	ret := make(map[ItemKey][]*spec.Schema, len(r.itemSchemata))
	for _, ss := range r.itemSchemata {
		key := NewItemKey(ss.slice, ss.index)
		if ss.schemata.one != nil {
			ret[key] = append(ret[key], ss.schemata.one)
		} else if len(ss.schemata.multiple) > 0 {
			ret[key] = append(ret[key], ss.schemata.multiple...)
		}
	}
	r.cachedItemSchemata = ret
	return ret
}
func (r *Result) resetCaches() {
	r.cachedFieldSchemta = nil
	r.cachedItemSchemata = nil
}
func (r *Result) mergeForField(obj map[string]interface{}, field string, other *Result) *Result {
	if other == nil {
		return r
	}
	r.mergeWithoutRootSchemata(other)
	if other.rootObjectSchemata.Len() > 0 {
		if r.fieldSchemata == nil {
			r.fieldSchemata = make([]fieldSchemata, len(obj))
		}
		r.fieldSchemata = append(r.fieldSchemata, fieldSchemata{
			obj:      obj,
			field:    field,
			schemata: other.rootObjectSchemata,
		})
	}
	return r
}
func (r *Result) mergeForSlice(slice reflect.Value, i int, other *Result) *Result {
	if other == nil {
		return r
	}
	r.mergeWithoutRootSchemata(other)
	if other.rootObjectSchemata.Len() > 0 {
		if r.itemSchemata == nil {
			r.itemSchemata = make([]itemSchemata, slice.Len())
		}
		r.itemSchemata = append(r.itemSchemata, itemSchemata{
			slice:    slice,
			index:    i,
			schemata: other.rootObjectSchemata,
		})
	}
	return r
}
func (r *Result) addRootObjectSchemata(s *spec.Schema) {
	r.rootObjectSchemata.Append(schemata{one: s})
}