Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable server-side validation #7

Open
arey opened this issue Dec 15, 2016 · 1 comment
Open

Enable server-side validation #7

arey opened this issue Dec 15, 2016 · 1 comment
Labels

Comments

@arey
Copy link
Member

arey commented Dec 15, 2016

Validation on server side has been removed in the Angular version.
PetValidator is disabled. You may save a pet with an empty name despite the @SiZe(min = 1) String name on PetRequest inner class. You may do a test :

curl -H "Content-Type: application/json" -X PUT -d '{"id":1,"name":"","birthDate":"2010-09-07","typeId":"1"}' http://localhost:8080/api/customer/owners/1/pets/1

More over, duplicate names are not handled.

Check the Spring Petclinic ReactJS version. Errors are correctly handled: https://github.com/spring-petclinic/spring-petclinic-reactjs
See classes: InvalidRequestException, ApiExceptionHandler, ErrorResource, FieldErrorResource

@arey arey added the bug label Dec 15, 2016
@ghost
Copy link

ghost commented Jun 8, 2017

I set up the webapplication without doing any modification on it and tried out your cURL-command, but got the following return:

{"timestamp":1496911194455,"status":404,"error":"Not Found","message":"No message available","path":"/api/customer/owners/1/pets/1"}

Trying to do the change you proposed directly in the GUI, I am able to add Pet instances with a single whitespace as name, but not with an entirely empty ("") name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant