Skip to content
This repository has been archived by the owner on Nov 24, 2018. It is now read-only.

Pattern validation is not working with @Pattern definition generated from the java project. #77

Closed
callmeberzerker opened this issue May 11, 2015 · 2 comments

Comments

@callmeberzerker
Copy link
Collaborator

Here is a sample @Pattern definition:

{"flags":[],"regexp":"/((?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{8,100})/","message":"{javax.validation.constraints.Pattern.message}"}

We can see that the regex is being stored in "regexp" field, NOT in constraint.value as seen in valdr.js L427. (var pattern = asRegExp(constraint.value))

Don't know who should fix this, the integrating project that is generating the @Pattern annotation definition or valdr.js.

@marcelstoer
Copy link
Collaborator

According to https://github.com/netceteragroup/valdr#pattern the field is called value and not regexp.

There was a related bug in valdr-bean-validation which was fixed with netceteragroup/valdr-bean-validation#28. It'll be part of the upcoming release.

@philippd
Copy link
Collaborator

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

No branches or pull requests

3 participants