Skip to content

Commit 3b68f4f

Browse files
committed
Merge pull request #691 from jaoromi/patch-1
insensitive range format
2 parents 3515adf + d8c8036 commit 3b68f4f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

modules/swagger-core/src/main/scala/com/wordnik/swagger/converter/ModelPropertyParser.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ class ModelPropertyParser(cls: Class[_], t: Map[String, String] = Map.empty) (im
2727
}
2828
val processedFields = new ListBuffer[String]
2929
val excludedFieldTypes = new HashSet[String]
30-
final val positiveInfinity = "Infinity"
31-
final val negativeInfinity = "-Infinity"
30+
final val positiveInfinity = "infinity"
31+
final val negativeInfinity = "-infinity"
3232

3333
def parse = Option(cls).map(parseRecursive(_))
3434

@@ -378,13 +378,13 @@ class ModelPropertyParser(cls: Class[_], t: Map[String, String] = Map.empty) (im
378378
}
379379
else {
380380
val min = ranges(0) match {
381-
case e: String if(e == positiveInfinity) => Float.PositiveInfinity
382-
case e: String if(e == negativeInfinity) => Float.NegativeInfinity
381+
case e: String if(e.toLowerCase() == positiveInfinity) => Float.PositiveInfinity
382+
case e: String if(e.toLowerCase() == negativeInfinity) => Float.NegativeInfinity
383383
case e: String => e.toFloat
384384
}
385385
val max = ranges(1) match {
386-
case e: String if(e == positiveInfinity) => Float.PositiveInfinity
387-
case e: String if(e == negativeInfinity) => Float.NegativeInfinity
386+
case e: String if(e.toLowerCase() == positiveInfinity) => Float.PositiveInfinity
387+
case e: String if(e.toLowerCase() == negativeInfinity) => Float.NegativeInfinity
388388
case e: String => e.toFloat
389389
}
390390
AllowableRangeValues(min.toString, max.toString)

0 commit comments

Comments
 (0)