func (v CommonValidations) HasNumberValidations() bool {
	return v.Maximum != nil || v.Minimum != nil || v.MultipleOf != nil
}
HasNumberValidations indicates if the validations are for numbers or integers
package spec
type CommonValidations struct {
	Maximum          *float64      `json:"maximum,omitempty"`
	ExclusiveMaximum bool          `json:"exclusiveMaximum,omitempty"`
	Minimum          *float64      `json:"minimum,omitempty"`
	ExclusiveMinimum bool          `json:"exclusiveMinimum,omitempty"`
	MaxLength        *int64        `json:"maxLength,omitempty"`
	MinLength        *int64        `json:"minLength,omitempty"`
	Pattern          string        `json:"pattern,omitempty"`
	MaxItems         *int64        `json:"maxItems,omitempty"`
	MinItems         *int64        `json:"minItems,omitempty"`
	UniqueItems      bool          `json:"uniqueItems,omitempty"`
	MultipleOf       *float64      `json:"multipleOf,omitempty"`
	Enum             []interface{} `json:"enum,omitempty"`
}
func (v *CommonValidations) SetValidations(val SchemaValidations) {
	v.Maximum = val.Maximum
	v.ExclusiveMaximum = val.ExclusiveMaximum
	v.Minimum = val.Minimum
	v.ExclusiveMinimum = val.ExclusiveMinimum
	v.MaxLength = val.MaxLength
	v.MinLength = val.MinLength
	v.Pattern = val.Pattern
	v.MaxItems = val.MaxItems
	v.MinItems = val.MinItems
	v.UniqueItems = val.UniqueItems
	v.MultipleOf = val.MultipleOf
	v.Enum = val.Enum
}
type clearedValidation struct {
	Validation string
	Value      interface{}
}
type clearedValidations []clearedValidation
func (c clearedValidations) apply(cbs []func(string, interface{})) {
	for _, cb := range cbs {
		for _, cleared := range c {
			cb(cleared.Validation, cleared.Value)
		}
	}
}
func (v *CommonValidations) ClearNumberValidations(cbs ...func(string, interface{})) {
	done := make(clearedValidations, 0, 5)
	defer func() {
		done.apply(cbs)
	}()
	if v.Minimum != nil {
		done = append(done, clearedValidation{Validation: "minimum", Value: v.Minimum})
		v.Minimum = nil
	}
	if v.Maximum != nil {
		done = append(done, clearedValidation{Validation: "maximum", Value: v.Maximum})
		v.Maximum = nil
	}
	if v.ExclusiveMaximum {
		done = append(done, clearedValidation{Validation: "exclusiveMaximum", Value: v.ExclusiveMaximum})
		v.ExclusiveMaximum = false
	}
	if v.ExclusiveMinimum {
		done = append(done, clearedValidation{Validation: "exclusiveMinimum", Value: v.ExclusiveMinimum})
		v.ExclusiveMinimum = false
	}
	if v.MultipleOf != nil {
		done = append(done, clearedValidation{Validation: "multipleOf", Value: v.MultipleOf})
		v.MultipleOf = nil
	}
}
func (v *CommonValidations) ClearStringValidations(cbs ...func(string, interface{})) {
	done := make(clearedValidations, 0, 3)
	defer func() {
		done.apply(cbs)
	}()
	if v.Pattern != "" {
		done = append(done, clearedValidation{Validation: "pattern", Value: v.Pattern})
		v.Pattern = ""
	}
	if v.MinLength != nil {
		done = append(done, clearedValidation{Validation: "minLength", Value: v.MinLength})
		v.MinLength = nil
	}
	if v.MaxLength != nil {
		done = append(done, clearedValidation{Validation: "maxLength", Value: v.MaxLength})
		v.MaxLength = nil
	}
}
func (v *CommonValidations) ClearArrayValidations(cbs ...func(string, interface{})) {
	done := make(clearedValidations, 0, 3)
	defer func() {
		done.apply(cbs)
	}()
	if v.MaxItems != nil {
		done = append(done, clearedValidation{Validation: "maxItems", Value: v.MaxItems})
		v.MaxItems = nil
	}
	if v.MinItems != nil {
		done = append(done, clearedValidation{Validation: "minItems", Value: v.MinItems})
		v.MinItems = nil
	}
	if v.UniqueItems {
		done = append(done, clearedValidation{Validation: "uniqueItems", Value: v.UniqueItems})
		v.UniqueItems = false
	}
}
func (v CommonValidations) Validations() SchemaValidations {
	return SchemaValidations{
		CommonValidations: v,
	}
}