code: func (r *ResourceDefinition) Validate() *dslengine.ValidationErrors {
  	verr := new(dslengine.ValidationErrors)
  	if r.Name == "" {
  		verr.Add(r, "Resource name cannot be empty")
  	}
  	r.validateActions(verr)
  	if r.ParentName != "" {
  		r.validateParent(verr)
  	}
  	for _, resp := range r.Responses {
  		verr.Merge(resp.Validate())
  	}
  	if r.Params != nil {
  		verr.Merge(r.Params.Validate("resource parameters", r))
  	}
  	for _, origin := range r.Origins {
  		verr.Merge(origin.Validate())
  	}
  	return verr.AsError()
  }
docs: // Validate tests whether the resource definition is consistent: action names are valid and each action is
  // valid.