mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 15:06:50 +00:00
refactor/update JsonSerializers to disable JDouble and JInt deserialization for BigDecimal
This commit is contained in:
parent
44b8c1bceb
commit
b5cd744412
@ -146,7 +146,8 @@ object BigDecimalSerializer extends Serializer[BigDecimal] {
|
||||
override def deserialize(implicit format: Formats): PartialFunction[(TypeInfo, JValue), BigDecimal] = {
|
||||
case (TypeInfo(IntervalClass, _), json) => json match {
|
||||
case JString(s) => BigDecimal(s)
|
||||
case JDouble(s) => BigDecimal(s)
|
||||
// case JDouble(s) => BigDecimal(s)// not safe,from JInt to BigDecimal, it may lose precision
|
||||
// case JInt(s) => BigDecimal(s) // not safe,from JInt to BigDecimal, it may lose precision
|
||||
case x => throw new MappingException("Can't convert " + x + " to BigDecimal")
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user