iris icon indicating copy to clipboard operation
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

Open StrangeYear opened this issue 3 years ago • 3 comments

@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

StrangeYear avatar Jun 28 '21 02:06 StrangeYear

Same issue (with empty body), any solution @kataras @StrangeYear ?

trungdlp-wolffun avatar Aug 30 '22 10:08 trungdlp-wolffun

@Kataras ?

job2wd avatar Mar 29 '23 10:03 job2wd

Same issue (with empty body), any solution @kataras @StrangeYear ?

i meet the same problem~

warjiang avatar Jun 26 '23 07:06 warjiang