Skip to content

Commit

Permalink
docs: updated docs based on refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Oudwins committed Sep 17, 2024
1 parent c83a7bb commit cce5dac
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,9 @@ conf.ErrorFormatter = func(e p.ZogError, p z.ParseCtx) {
}

// override specific error messages
// For this you will need to import `zog/primitives` package. Which you should use with caution since it is an internal package
conf.DefaultErrMsgMap["string"]["my_custom_error_code"] = "my custom error message"
// For this I recommend you import `zod/zconst` which contains zog constants
conf.DefaultErrMsgMap[zconst.TypeString]["my_custom_error_code"] = "my custom error message"
conf.DefaultErrMsgMap[zconst.TypeString][zconst.ErrCodeRequired] = "Now all required errors will get this message"
```

## Zog Schema Parsign Execution Structure
Expand Down

0 comments on commit cce5dac

Please sign in to comment.