code: func (r *Resource) inheritResourceType(resourceTypes map[string]ResourceType, apiDef *APIDefinition) error {
  	// get resource type object to inherit
  	rt, err := r.getResourceType(resourceTypes)
  	if rt == nil || err != nil {
  		return err
  	}
  
  	// initialize dicts
  	dicts := initResourceTypeDicts(r, r.Type.Parameters)
  
  	r.Description = substituteParams(r.Description, rt.Description, dicts)
  
  	// uri parameters
  	if len(r.URIParameters) == 0 {
  		r.URIParameters = map[string]NamedParameter{}
  	}
  	for name, up := range rt.URIParameters {
  		p, ok := r.URIParameters[name]
  		if !ok {
  			p = NamedParameter{}
  		}
  		p.inherit(up, dicts)
  		r.URIParameters[name] = p
  	}
  
  	// methods
  	r.inheritMethods(rt, apiDef)
  
  	return nil
  }
docs: // inherit from a resource type