code: func NegotiateMediaTypeOptions(header string, accepted []runtime.SerializerInfo, endpoint EndpointRestrictions) (MediaTypeOptions, bool) {
  	if len(header) == 0 && len(accepted) > 0 {
  		return MediaTypeOptions{
  			Accepted: accepted[0],
  		}, true
  	}
  
  	var candidates candidateMediaTypeSlice
  	clauses := goautoneg.ParseAccept(header)
  	for _, clause := range clauses {
  		for i := range accepted {
  			accepts := &accepted[i]
  			switch {
  			case clause.Type == accepts.MediaTypeType && clause.SubType == accepts.MediaTypeSubType,
  				clause.Type == accepts.MediaTypeType && clause.SubType == "*",
  				clause.Type == "*" && clause.SubType == "*":
  				candidates = append(candidates, candidateMediaType{accepted: accepts, clauses: clause})
  			}
  		}
  	}
  
  	for _, v := range candidates {
  		if retVal, ret := acceptMediaTypeOptions(v.clauses.Params, v.accepted, endpoint); ret {
  			return retVal, true
  		}
  	}
  
  	return MediaTypeOptions{}, false
  }
docs: // NegotiateMediaTypeOptions returns the most appropriate content type given the accept header and
  // a list of alternatives along with the accepted media type parameters.