Uploaded image for project: 'Olingo'
  1. Olingo
  2. OLINGO-1354

ODataJsonDeserializer fails to de-serialize json with BigDecimal values

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • (Java) V4 4.4.0, (Java) V4 4.5.0
    • None
    • odata4-server
    • None

    Description

      ODataJsonDeserializer  fails to de-serializer the json with big decimal values.

      As it is using ObjectMapper internally to deserialize the json, but default objectmapper instance can't deserialize json with bigdecimals.

      Once we configure object mapper with "objectMapper.configure(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS, true);", then it can deserialize the bigdecimal fields too.

      As the deserialization logic is part of of private method "parseJsonTree", couldn't override too.

      So what should be ideal solution to this.

      Payload 

      { "EmploymentId" : "1234", "TotalPay" : 10000000.0018, "Status" : "HIRED" }

      Error message : 

       
      "message": "Entity Collection can not be found due to some internal server error: Invalid value: 1.00000000018E7 for property: TotalPay"
       

      Attachments

        Activity

          People

            Unassigned Unassigned
            prbabumahesh Babu Mahesh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: