code: func knownDefGoType(def string, schema spec.Schema, clear func(string) string) (string, string, string) {
  	debugLog("known def type: %q", def)
  	ext := schema.Extensions
  	if nm, ok := ext.GetString(xGoName); ok {
  		if clear == nil {
  			debugLog("known def type %s no clear: %q", xGoName, nm)
  			return nm, "", ""
  		}
  		debugLog("known def type %s clear: %q -> %q", xGoName, nm, clear(nm))
  		return clear(nm), "", ""
  	}
  	v, ok := ext[xGoType]
  	if !ok {
  		if clear == nil {
  			debugLog("known def type no clear: %q", def)
  			return def, "", ""
  		}
  		debugLog("known def type clear: %q -> %q", def, clear(def))
  		return clear(def), "", ""
  	}
  	xt := v.(map[string]interface{})
  	t := xt["type"].(string)
  	impIface, ok := xt["import"]
  
  	if !ok {
  		return t, "", ""
  	}
  
  	imp := impIface.(map[string]interface{})
  	pkg := imp["package"].(string)
  	al, ok := imp["alias"]
  	var alias string
  	if ok {
  		alias = al.(string)
  	} else {
  		alias = path.Base(pkg)
  	}
  	debugLog("known def type %s no clear: %q: pkg=%s, alias=%s", xGoType, alias+"."+t, pkg, alias)
  	return alias + "." + t, pkg, alias
  }
docs: // knownDefGoType returns go type, package and package alias for definition