Closed mesut closed 5 years ago
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
Merging #481 into develop will decrease coverage by
<.01%
. The diff coverage is88.46%
.
@@ Coverage Diff @@
## develop #481 +/- ##
===========================================
- Coverage 92.64% 92.64% -0.01%
===========================================
Files 240 241 +1
Lines 3835 3861 +26
Branches 304 304
===========================================
+ Hits 3553 3577 +24
- Misses 282 284 +2
Impacted Files | Coverage Δ | |
---|---|---|
...class/validation/validators/PatternValidator.scala | 88.46% <88.46%> (ø) |
|
...finatra/validation/ValidationMessageResolver.scala | 91.66% <0%> (+8.33%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update d3f833a...c4a6460. Read the comment docs.
cla problem
finatra-jackson: added
@Pattern
annotation for regex based string validationProblem
We should able to validate http request parameters whether match the given regex pattern. For instance, Finatra should able to validate phone parameter whether matches to phone pattern.
case class MyRequest(phone: String)
Solution
Added
@Pattern
annotation to finatra-jackson for regex based validation. If the regex do not match, it will return PatternNotMatches errorCode which contains the regex and valueResult With
@Pattern
annotation we provide regex that checks the parameter match or not.case class MyRequest( @Pattern(regexp= "^[+][(]{0,1}[0-9]{1,4}[)]{0,1}[-\s./0-9]$") phone: String)