[BUG] Custom .Error
does not work on schemas other than @Required
#2696
Labels
.Error
does not work on schemas other than @Required
#2696
Describe the bug
Here is a request object:
And the controller
I expect to get a custom error message when I make
curl localhost:8083/body -XPOST -H "Content-Type: application/json" -d '{"title":"short"}'
but still get the generic message:I tried a few different decorators. It looks like only the
@Required
decorator works.To Reproduce
npm i
npm start
curl localhost:8083/body -XPOST -H "Content-Type: application/json" -d '{"prop1":"asd"}' | jq .
Expected behavior
Expected to see
Title must be at least 10 characters long
message.Code snippets
No response
Repository URL example
https://github.com/ktalebian/tsed-bug
OS
macOS
Node version
Node 20
Library version
v7.*
Additional context
No response
The text was updated successfully, but these errors were encountered: