code: func (apiDef *APIDefinition) allTraits(trts map[string]Trait, libraries map[string]*Library) map[string]Trait {
  	if len(trts) == 0 {
  		trts = map[string]Trait{}
  	}
  	for libName, l := range libraries {
  		for trtName, trt := range l.Traits {
  			trts[libName+"."+trtName] = trt
  		}
  		// Recursively processing siblings
  		if l.Libraries != nil {
  			apiDef.allTraits(trts, l.Libraries)
  		}
  	}
  	return trts
  }
docs: // allTraits gets all traits that defined in this api definition.
  // traits could be from:
  // - the root APIDefinition
  // - libraries