JSON Reads max and min combinators should work on any Numeric#1363
JSON Reads max and min combinators should work on any Numeric#1363jroper merged 2 commits intoplayframework:masterfrom
Conversation
Beforehand it only worked on Int
|
play2-master-PRs #392 SUCCESS |
There was a problem hiding this comment.
Maybe not using the word "size", it's more about the value, isn't it?
There was a problem hiding this comment.
Yes you're right, fixed it.
There was a problem hiding this comment.
no you can commit on your branch and the PR is updated!
On Fri, Jul 19, 2013 at 3:10 PM, Marius Soutier notifications@github.comwrote:
In
framework/src/play-json/src/main/scala/play/api/libs/json/JsConstraints.scala:@@ -112,11 +112,19 @@ trait ConstraintReads {
def seq[A](implicit reads: Reads[A]): Reads[Seq[A]] = Reads.traversableReads[Seq, A]
def map[A](implicit reads: Reads[A]): Reads[collection.immutable.Map[String, A]] = Reads.mapReads[A]
- def min(m: Int)(implicit reads: Reads[Int]) =
- filterNot[Int](ValidationError%28"error.min", m%29)(_ < m)(reads)
- /**
- * Defines a minimum size for a numeric Reads. Combine with
maxusingor, e.g.Yes you're right... I guess I have to close this PR and submit a new one?
—
Reply to this email directly or view it on GitHubhttps://github.com//pull/1363/files#r5291461
.
There was a problem hiding this comment.
Thanks, see below. value was just the word I was looking for but then I resorted to size.
|
Seems OK ;) |
|
play2-master-PRs #393 SUCCESS |
JSON Reads max and min combinators should work on any Numeric
The
Reads.minandReads.maxcombinators in play-json currently only work on Int, but there's no reason it shouldn't work any any Numeric.