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

Method AllRequired

expr/attribute.go:434–442  ·  view source on GitHub ↗

AllRequired returns the list of all required fields from the underlying object. This method recurses if the type is itself an attribute (i.e. a UserType, this happens with the Reference DSL for example).

()

Source from the content-addressed store, hash-verified

432// object. This method recurses if the type is itself an attribute (i.e. a
433// UserType, this happens with the Reference DSL for example).
434func (a *AttributeExpr) AllRequired() []string {
435 if u, ok := a.Type.(UserType); ok {
436 return u.Attribute().AllRequired()
437 }
438 if a.Validation != nil {
439 return a.Validation.Required
440 }
441 return nil
442}
443
444// IsRequired returns true if the given string matches the name of a required
445// attribute, false otherwise. This method only applies to attributes of type

Callers 4

ValidateMethod · 0.95
IsRequiredMethod · 0.95
IsRequiredNoDefaultMethod · 0.95

Calls 1

AttributeMethod · 0.65

Tested by 1