code: func (o *UpdateUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
  	var res []error
  
  	o.HTTPRequest = r
  
  	if runtime.HasBody(r) {
  		defer r.Body.Close()
  		var body models.User
  		if err := route.Consumer.Consume(r.Body, &body); err != nil {
  			res = append(res, errors.NewParseError("body", "body", "", err))
  		} else {
  			// validate body object
  			if err := body.Validate(route.Formats); err != nil {
  				res = append(res, err)
  			}
  
  			if len(res) == 0 {
  				o.Body = &body
  			}
  		}
  	}
  	rUsername, rhkUsername, _ := route.Params.GetOK("username")
  	if err := o.bindUsername(rUsername, rhkUsername, route.Formats); err != nil {
  		res = append(res, err)
  	}
  
  	if len(res) > 0 {
  		return errors.CompositeValidationError(res...)
  	}
  	return nil
  }
docs: // BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
  // for simple values it will use straight method calls.
  //
  // To ensure default values, the struct must have been initialized with NewUpdateUserParams() beforehand.