Skip to content

Commit

Permalink
📖 docs: v1.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
maktoobgar committed Aug 19, 2023
1 parent 854732e commit 2020940
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ CHANGELOG
UNRELEASED
----------


1.3.5 (2023-08-19)
------------------

* 🐛 fix: bug fixed on setting error messages for conflicted keys in tags

1.3.4 (2023-07-11)
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,16 @@ If you don't send `username` or send it empty in json request body, this message
{"message":{"username":"username is required"}}
```

**Note**: In cases which there is a conflict of names for rule messages(like `json`, `json` tag is used for output in json and if you want to add error message of json for it, you can't use `json` tag, so the solution is to use `_json` tag)

Example:

```go
type login struct {
Field string `json:"field" binding:"required,json" _json:"$field is not json"`
}
```

## 2. Translate Error Output to Different Languages in [Gin]((https://github.com/gin-gonic/gin))

If you need to translate output error messages for different languages in a gin project, use this template:
Expand Down

0 comments on commit 2020940

Please sign in to comment.