(def any, isArray bool, minLength *int)
| 779 | } |
| 780 | |
| 781 | func initMinLengthValidation(def any, isArray bool, minLength *int) { |
| 782 | switch actual := def.(type) { |
| 783 | case *Parameter: |
| 784 | if isArray { |
| 785 | actual.MinItems = minLength |
| 786 | } else { |
| 787 | actual.MinLength = minLength |
| 788 | } |
| 789 | case *Header: |
| 790 | actual.MinLength = minLength |
| 791 | case *Items: |
| 792 | actual.MinLength = minLength |
| 793 | } |
| 794 | } |
| 795 | |
| 796 | func initMaxLengthValidation(def any, isArray bool, maxLength *int) { |
| 797 | switch actual := def.(type) { |