You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Oliver
I was trying to add validation in the same project, but it didn't worked properly.
When I give bean name as beforeSaveItemValidator its not working, eventhough beforeCreateItemValidator is working as expected.
Can you please help me, or can you add validation in this restbucks project.
Hi Oliver
I was trying to add validation in the same project, but it didn't worked properly.
When I give bean name as beforeSaveItemValidator its not working, eventhough beforeCreateItemValidator is working as expected.
Can you please help me, or can you add validation in this restbucks project.
Here is the output
When bean is beforeCreateItemValidator()
Validation is working ---> 400 Bad Request
curl -v -X POST -H "Content-Type: application/json" -d '{ "id" :4, "quantity" : 44 }' http://localhost:8080/item/
{"errors":[{"entity":"Item","message":"Item name required","invalidValue":"null","property":"name"}]}
but When bean is beforeSaveItemValidator()
Validation is not working ---> 201 Created
curl -v -X POST -H "Content-Type: application/json" -d '{ "id" :4, "quantity" : 44 }' http://localhost:8080/item/
You can get the changes here
https://github.com/guptasujeet/spring-restbucks.git
The text was updated successfully, but these errors were encountered: