kataras / kataras/iris

[BUG] Unable to attach Validator on iris Application

Open
#1,754 3 comments 0 reactions 1 assignee Claimed by @kataras View on GitHub
🐞 type:bug
Dominant language
Go
Stars
25.6k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
A clear and concise description of what the bug is.
Unable to attach validator on iris Application instance.

app.Validator undefined (type *iris.Application has no field or method Validator)

**To Reproduce**
Steps to reproduce the behavior:
example here
https://github.com/kataras/iris/blob/master/_examples/request-body/read-json-struct-validation/main.go

**Expected behavior**
A clear and concise description of what you expected to happen.
Validator should attach
**Screenshots**
![image](https://user-images.githubusercontent.com/64830337/114704751-977fbc80-9d44-11eb-8b82-815f55a324cd.png)

**Desktop (please complete the following information):**
- OS: [e.g. ubuntu, windows]

**iris.Version**
- e.g. v12.2.0-alpha or master

Please make sure the bug is reproducible over the `master` branch:

```sh
$ cd PROJECT
$ go get -u github.com/kataras/iris/v12@master
$ go run .
```

**Additional context**
Add any other context about the problem here.
Even if i use ```readJSON``` to read the body with struct tags described in example, no error is thrown. validator is expected to run manually. Am i missing anything?

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.