code: func (r *Resource) resourcePathName() string {
  	// remove trailing slash
  	uri := strings.TrimSuffix(r.URI, "/")
  
  	if uri != "" && !strings.HasSuffix(uri, "}") {
  		// check if it is non-URI params, which ended by "}"
  		elems := strings.Split(uri, "/")
  		return elems[len(elems)-1]
  	}
  	if r.Parent == nil {
  		return ""
  	}
  	return r.Parent.resourcePathName()
  }
docs: // from spec : the rightmost of the non-URI-parameter-containing path fragments.