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

Api Returns statuts 500 (internal server error) if a validation fails. #12

Open
leoek opened this issue Apr 27, 2018 · 0 comments
Open
Labels
bug Something isn't working

Comments

@leoek
Copy link
Collaborator

leoek commented Apr 27, 2018

actual:

{
  "timestamp" : "2018-04-27T02:14:12.161+0000",
  "status" : 500,
  "error" : "Internal Server Error",
  "message" : "Validation failed for classes [de.ul.swtp.modules.contactmanagement.Contact] during persist time for groups [javax.validation.groups.Default, ]\nList of constraint violations:[\n\tConstraintViolationImpl{interpolatedMessage='must not be blank', propertyPath=address, rootBeanClass=class de.ul.swtp.modules.contactmanagement.Contact, messageTemplate='{javax.validation.constraints.NotBlank.message}'}\n\tConstraintViolationImpl{interpolatedMessage='must not be blank', propertyPath=lastName, rootBeanClass=class de.ul.swtp.modules.contactmanagement.Contact, messageTemplate='{javax.validation.constraints.NotBlank.message}'}\n\tConstraintViolationImpl{interpolatedMessage='must not be blank', propertyPath=firstName, rootBeanClass=class de.ul.swtp.modules.contactmanagement.Contact, messageTemplate='{javax.validation.constraints.NotBlank.message}'}\n]",
  "path" : "/contacts"
}

expected:
status 400 and a useful message

request to reproduce:

curl 'https://api.swt.leoek.eu/contacts?' -H 'origin: http://localhost:3000' -H 'accept-encoding: gzip, deflate, br' -H 'accept-language: en-US,en;q=0.9,de-DE;q=0.8,de;q=0.7,fr-FR;q=0.6,fr;q=0.5' -H 'authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbkB0ZXN0LmNvbSIsImV4cCI6MTUyNTM4MjU4NCwiaWF0IjoxNTI0Nzc3Nzg0fQ.uN1IvTFpCkhR4gipepXs2jiN92lOyh5F1fSehRMm0TUFuamvtWfoDV3GpfPcjYR_4zEbRd1VL6XBHjEZRP3FVw' -H 'pragma: no-cache' -H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36' -H 'content-type: application/json; charset=utf-8' -H 'accept: */*' -H 'cache-control: no-cache' -H 'authority: api.swt.leoek.eu' -H 'referer: http://localhost:3000/contact/create' -H 'dnt: 1' --data-binary '{}' --compressed
@leoek leoek changed the title Api Returns statuts 500: internal server error if a validation fails. Api Returns statuts 500 (internal server error) if a validation fails. Apr 27, 2018
@felixfoertsch felixfoertsch added the bug Something isn't working label Apr 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants