kataras / kataras/iris

[BUG] schema: invalid path "username"

Open
#2,456 1 comment 0 reactions 1 assignee Claimed by @kataras View on GitHub
Dominant language
Go
Stars
25.6k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
Browser shows:
schema: invalid path "username"schema: invalid path "username"

**To Reproduce**
Steps to reproduce the behavior:
codes as follow:
```
//main.go
user := mvc.New(app.Party("/my"))
user.Register(
userService,
sessManager.Start,
)
user.Handle(new(controller.MyController))

//my_controller.go
type MyController struct {
Ctx iris.Context
Service service.UserService
Session *sessions.Session
}

func (c *MyController) GetLogin() mvc.Result {
return mvc.View{
Name: "my/login.html",
}
}

type loginForm struct {
Username string `form:"username"`
}

func (c *MyController) PostLogin(form loginForm) mvc.Result {
fmt.Println(form.Username)
return mvc.Response{
Path: "/my/login",
}
}

//my/login.html


Username

Login

```
After click the login button, the page shows :
schema: invalid path "username"schema: invalid path "username"

**Desktop (please complete the following information):**
- OS: debian

**iris.Version**
- v12.2.11

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.