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

Method Validate

expr/server.go:59–73  ·  view source on GitHub ↗

Validate validates the server and server hosts.

()

Source from the content-addressed store, hash-verified

57
58// Validate validates the server and server hosts.
59func (s *ServerExpr) Validate() error {
60 verr := new(eval.ValidationErrors)
61 for _, h := range s.Hosts {
62 var verrs *eval.ValidationErrors
63 if errors.As(h.Validate(), &verrs) {
64 verr.Merge(verrs)
65 }
66 }
67 for _, svc := range s.Services {
68 if Root.Service(svc) == nil {
69 verr.Add(s, "service %q undefined", svc)
70 }
71 }
72 return verr
73}
74
75// Finalize initializes the server services and/or host with default values if
76// not set explicitly in the design.

Callers 1

TestServerExprValidateFunction · 0.95

Calls 4

AddMethod · 0.80
ValidateMethod · 0.65
ServiceMethod · 0.65
MergeMethod · 0.45

Tested by 1

TestServerExprValidateFunction · 0.76