Skip to content

Commit

Permalink
fix: fix upload specify file format is fail (IceWhaleTech#1613)
Browse files Browse the repository at this point in the history
  • Loading branch information
CorrectRoadH authored Jan 18, 2024
1 parent 54a115a commit 29d16d1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions route/v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ func InitV2Router() http.Handler {
// })

e.Use(middleware.OapiRequestValidatorWithOptions(_swagger, &middleware.Options{
Skipper: func(c echo.Context) bool {
// jump validate when upload file
// because file upload can't pass validate
// issue: https://github.com/deepmap/oapi-codegen/issues/514
return strings.Contains(c.Request().URL.Path, "file/upload")
},
Options: openapi3filter.Options{AuthenticationFunc: openapi3filter.NoopAuthenticationFunc},
}))

Expand Down

0 comments on commit 29d16d1

Please sign in to comment.