iris
iris copied to clipboard
In MVC mode, no matter get or post request, if the url or form parameter is not passed, no error will be triggered
@kataras
same question,In MVC mode, no matter get or post request, if the url or form parameter is not passed, no error will be triggered。
app := iris.New()
app.Validator = validator.New()
// MVC
func (c *ApiController) GetFinanceTest(p struct {
PayIds string `url:"pay_ids" validate:"required"`
AccId int `url:"acc_id" validate:"required,min=1"`
}) {
// If an error occurs normally, it should not be executed here, but it passed
fmt.Println(p.AccId) // = 0
}
// _ = app.Listen(":8080")
app.Listen(":8080", iris.WithEmptyFormError) // ?
Originally posted by @hjzCy in https://github.com/kataras/iris/issues/1625#issuecomment-816372692
Same issue (with empty body), any solution @kataras @StrangeYear ?
@Kataras ?
Same issue (with empty body), any solution @kataras @StrangeYear ?
i meet the same problem~