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).
()
| 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). |
| 434 | func (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 |