update
This commit is contained in:
@@ -40,11 +40,11 @@ type CreateFeedbackParams struct {
|
||||
In: body
|
||||
*/
|
||||
Body *models.Feedback
|
||||
/*Session ID
|
||||
/*Session UUID
|
||||
Required: true
|
||||
In: query
|
||||
*/
|
||||
SessionID string
|
||||
SessionUUID string
|
||||
}
|
||||
|
||||
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
|
||||
@@ -86,8 +86,8 @@ func (o *CreateFeedbackParams) BindRequest(r *http.Request, route *middleware.Ma
|
||||
res = append(res, errors.Required("body", "body", ""))
|
||||
}
|
||||
|
||||
qSessionID, qhkSessionID, _ := qs.GetOK("session_id")
|
||||
if err := o.bindSessionID(qSessionID, qhkSessionID, route.Formats); err != nil {
|
||||
qSessionUUID, qhkSessionUUID, _ := qs.GetOK("session_uuid")
|
||||
if err := o.bindSessionUUID(qSessionUUID, qhkSessionUUID, route.Formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
if len(res) > 0 {
|
||||
@@ -96,10 +96,10 @@ func (o *CreateFeedbackParams) BindRequest(r *http.Request, route *middleware.Ma
|
||||
return nil
|
||||
}
|
||||
|
||||
// bindSessionID binds and validates parameter SessionID from query.
|
||||
func (o *CreateFeedbackParams) bindSessionID(rawData []string, hasKey bool, formats strfmt.Registry) error {
|
||||
// bindSessionUUID binds and validates parameter SessionUUID from query.
|
||||
func (o *CreateFeedbackParams) bindSessionUUID(rawData []string, hasKey bool, formats strfmt.Registry) error {
|
||||
if !hasKey {
|
||||
return errors.Required("session_id", "query", rawData)
|
||||
return errors.Required("session_uuid", "query", rawData)
|
||||
}
|
||||
var raw string
|
||||
if len(rawData) > 0 {
|
||||
@@ -109,10 +109,10 @@ func (o *CreateFeedbackParams) bindSessionID(rawData []string, hasKey bool, form
|
||||
// Required: true
|
||||
// AllowEmptyValue: false
|
||||
|
||||
if err := validate.RequiredString("session_id", "query", raw); err != nil {
|
||||
if err := validate.RequiredString("session_uuid", "query", raw); err != nil {
|
||||
return err
|
||||
}
|
||||
o.SessionID = raw
|
||||
o.SessionUUID = raw
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user