code: func MediaTypeRef(api *design.APIDefinition, mt *design.MediaTypeDefinition, view string) string {
  	projected, _, err := mt.Project(view)
  	if err != nil {
  		panic(fmt.Sprintf("failed to project media type %#v: %s", mt.Identifier, err)) // bug
  	}
  	if _, ok := Definitions[projected.TypeName]; !ok {
  		GenerateMediaTypeDefinition(api, projected, "default")
  	}
  	ref := fmt.Sprintf("#/definitions/%s", projected.TypeName)
  	return ref
  }
docs: // MediaTypeRef produces the JSON reference to the media type definition with the given view.