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

Function AttributeValidationCode

codegen/validation.go:66–68  ·  view source on GitHub ↗

AttributeValidationCode produces Go code that runs the validations defined in the given attribute against the value held by the variable named target. See ValidationCode for a description of the arguments.

(att *expr.AttributeExpr, put expr.UserType, attCtx *AttributeContext, req, alias bool, target, attName string)

Source from the content-addressed store, hash-verified

64//
65// See ValidationCode for a description of the arguments.
66func AttributeValidationCode(att *expr.AttributeExpr, put expr.UserType, attCtx *AttributeContext, req, alias bool, target, attName string) string {
67 return recurseValidationCode(att, put, attCtx, req, alias, false, target, attName, nil).String()
68}
69
70// ValidationCode produces Go code that runs the validations defined in the
71// given attribute and its children recursively against the value held by the

Callers 8

analyzeMethod · 0.92
buildPayloadDataMethod · 0.92
extractPathParamsMethod · 0.92
extractQueryParamsMethod · 0.92
extractHeadersMethod · 0.92
extractCookiesMethod · 0.92
collectValidationsRFunction · 0.92
extractMetadataFunction · 0.92

Calls 2

recurseValidationCodeFunction · 0.85
StringMethod · 0.65

Tested by

no test coverage detected