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

Method inheritValidations

expr/attribute.go:818–826  ·  view source on GitHub ↗
(parent *AttributeExpr)

Source from the content-addressed store, hash-verified

816}
817
818func (a *AttributeExpr) inheritValidations(parent *AttributeExpr) {
819 if parent.Validation == nil {
820 return
821 }
822 if a.Validation == nil {
823 a.Validation = &ValidationExpr{}
824 }
825 a.Validation.AddRequired(parent.Validation.Required...)
826}
827
828func (a *AttributeExpr) shouldInherit(parent *AttributeExpr) bool {
829 return a != nil && AsObject(a.Type) != nil &&

Callers 2

InheritMethod · 0.95
inheritRecursiveMethod · 0.80

Calls 1

AddRequiredMethod · 0.80

Tested by

no test coverage detected