Skip to content

Commit

Permalink
Merge pull request #90 from vortex14/swagger
Browse files Browse the repository at this point in the history
skip validate request body
  • Loading branch information
vortex14 authored Sep 8, 2023
2 parents 3f0f9f3 + 41497e2 commit 7b73f5b
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions extensions/servers/gin/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,21 +87,21 @@ func (s *TyphoonGinServer) onRequestHandler(ginCtx *Gin.Context) {
}
}

if action.IsValidRequestBody() {
//if action.IsValidRequestBody() {

body := action.GetRequestModel()
data := *&body
err := ginCtx.ShouldBindJSON(data)

if err != nil {
s.LOG.Error(Errors.ActionErrRequestModel.Error())
ginCtx.JSON(422, forms.ErrorResponse{Error: err.Error()})
return
} else {
ginCtx.Set("body", data)
}
//body := action.GetRequestModel()
//data := *&body
//err := ginCtx.ShouldBindJSON(data)
//
//if err != nil {
// s.LOG.Error(Errors.ActionErrRequestModel.Error())
// ginCtx.JSON(422, forms.ErrorResponse{Error: err.Error()})
// return
//} else {
// ginCtx.Set("body", data)
//}

}
//}

action.OnRequest(ginCtx.Request.Method, reservedRequestPath)

Expand Down

0 comments on commit 7b73f5b

Please sign in to comment.