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

Method validateParent

expr/http_service.go:239–257  ·  view source on GitHub ↗

validateParent validates parent service configuration

(verr *eval.ValidationErrors)

Source from the content-addressed store, hash-verified

237
238// validateParent validates parent service configuration
239func (svc *HTTPServiceExpr) validateParent(verr *eval.ValidationErrors) {
240 n := svc.ParentName
241 if n == "" {
242 return
243 }
244
245 p := svc.Root.Service(n)
246 if p == nil {
247 verr.Add(svc, "Parent service %s not found", n)
248 return
249 }
250
251 if p.CanonicalEndpoint() == nil {
252 verr.Add(svc, "Parent service %s has no canonical endpoint", n)
253 }
254 if p.ParentName == svc.Name() {
255 verr.Add(svc, "Parent service %s is also child", n)
256 }
257}
258
259// validateCanonicalEndpoint validates canonical endpoint configuration
260func (svc *HTTPServiceExpr) validateCanonicalEndpoint(verr *eval.ValidationErrors) {

Callers 1

ValidateMethod · 0.95

Calls 4

NameMethod · 0.95
AddMethod · 0.80
CanonicalEndpointMethod · 0.80
ServiceMethod · 0.65

Tested by

no test coverage detected