Skip to content

Field name included in custom error messages#487

Open
jorgefuertes wants to merge 2 commits intoasaskevich:masterfrom
jorgefuertes:master
Open

Field name included in custom error messages#487
jorgefuertes wants to merge 2 commits intoasaskevich:masterfrom
jorgefuertes:master

Conversation

@jorgefuertes
Copy link
Copy Markdown

@jorgefuertes jorgefuertes commented Jan 29, 2023

Q A
Documentation no
Bugfix yes
BC Break no
New Feature no
RFC no
QA no

Description

The error strings are different from the provided error messages to the custom error messages. First ones included the field name. When using this feature from a front application, for example, with the custom error message you don't know which field is referred.

Go validator error message:
password: does not validate as stringlength(3|50)

Custom error messages:
Should have between 3 to 50 chars.

While it should be:
password: Should have between 3 to 50 chars.

I've modified the test to be OK with the new custom messages.


This change is Reviewable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant