code: func (w *MediaTypesWriter) Execute(mt *design.MediaTypeDefinition) error {
  	var (
  		mLinks *design.UserTypeDefinition
  		fn     = template.FuncMap{"validationCode": w.Validator.Code}
  	)
  	err := mt.IterateViews(func(view *design.ViewDefinition) error {
  		p, links, err := mt.Project(view.Name)
  		if mLinks == nil {
  			mLinks = links
  		}
  		if err != nil {
  			return err
  		}
  		return w.ExecuteTemplate("mediatype", mediaTypeT, fn, p)
  	})
  	if err != nil {
  		return err
  	}
  	if mLinks != nil {
  		if err := w.ExecuteTemplate("mediatypelink", mediaTypeLinkT, fn, mLinks); err != nil {
  			return err
  		}
  	}
  	return nil
  }
docs: // Execute writes the code for the context types to the writer.