code: func (b *codeGenOpBuilder) HasValidations(sh spec.CommonValidations, rt resolvedType) (hasValidations bool, hasSliceValidations bool) {
  	// TODO: exclude format byte (istrfmt.Base64) from validation (issue#1548)
  	hasNumberValidation := sh.Maximum != nil || sh.Minimum != nil || sh.MultipleOf != nil
  	hasStringValidation := sh.MaxLength != nil || sh.MinLength != nil || sh.Pattern != ""
  	hasSliceValidations = sh.MaxItems != nil || sh.MinItems != nil || sh.UniqueItems || len(sh.Enum) > 0
  	hasValidations = (hasNumberValidation || hasStringValidation || hasSliceValidations || rt.IsCustomFormatter) && !rt.IsStream && !rt.IsInterface
  	return
  }
docs: // HasValidations resolves the validation status for simple schema objects