MCPcopy Create free account
hub / github.com/goadesign/goa / initMaxLengthValidation

Function initMaxLengthValidation

http/codegen/openapi/v2/builder.go:796–809  ·  view source on GitHub ↗
(def any, isArray bool, maxLength *int)

Source from the content-addressed store, hash-verified

794}
795
796func 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
811func initValidations(attr *expr.AttributeExpr, def any) {
812 val := attr.Validation

Callers 1

initValidationsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected