i18n with fastest-validator #1083
Unanswered
mtcarvalho
asked this question in
Q&A
Replies: 1 comment
-
Hi @mtcarvalho |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have this method and schema
And I have to translate the validation messages to PT-BR using fastest-validator.
I created this file to use the messages as I need.
However, I don't know how to use them after importing the custom validator inside my service.
I saw here how to import the translated validation, and here how to set my custom validator. I tried this code:
but I don't know if I stay with
params
at the action level.Maybe I need to create a custom class, like Joi example? If yes, how should I change
params
?At the end of the day, what I need is: if I send the following body:
The response should be:
And so on, for nested fields as well.
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions