Function
initMaxLengthValidation
(def any, isArray bool, maxLength *int)
Source from the content-addressed store, hash-verified
| 794 | } |
| 795 | |
| 796 | func initMaxLengthValidation(def any, isArray bool, maxLength *int) { |
| 797 | switch actual := def.(type) { |
| 798 | case *Parameter: |
| 799 | if isArray { |
| 800 | actual.MaxItems = maxLength |
| 801 | } else { |
| 802 | actual.MaxLength = maxLength |
| 803 | } |
| 804 | case *Header: |
| 805 | actual.MaxLength = maxLength |
| 806 | case *Items: |
| 807 | actual.MaxLength = maxLength |
| 808 | } |
| 809 | } |
| 810 | |
| 811 | func initValidations(attr *expr.AttributeExpr, def any) { |
| 812 | val := attr.Validation |
Tested by
no test coverage detected