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

Olingo Liabrary is not able to parse DataTime with nanosecond value which is other than 0 or divisible by 1000000

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Not A Problem
    • None
    • V2 2.0.10, V2 2.0.11
    • None
    • None

    Description

      Olingo is not able to parse DataTime value where nanosecond is not 0 or divisible by 1000000

       

      eg: 2014-01-10T20:02:08.8757980Z

       

      I have debugged the issue, this issue is happening because of wrong validation of DateTime format in olingo library.

       

      Class: org.apache.olingo.odata2.core.edm.EdmDateTimeOffset.class

       

      if ((nanoSeconds % 1000000 != 0) && (!(returnType.isAssignableFrom(Timestamp.class)))) {

      /* 119 */         throw new EdmSimpleTypeException(EdmSimpleTypeException.LITERAL_ILLEGAL_CONTENT.addContent(new Object[] { value }));

      /*     */       }

       

      As per above code olingo expects the nanosecond should always be 0 or divisible by 1000000,  Which is not the case in StartDateTime field of Task businessObject.

       

      Valid payload:

       

      <d:DueDateTime m:type="c4codata.LOCALNORMALISED_DateTime">

                     <d:timeZoneCode/>

                     <d:content>2014-01-10T20:32:08.0000000Z</d:content>

      </d:DueDateTime>

       

      Invalid Payload:

       ** 

      <d:StartDateTime m:type="c4codata.LOCALNORMALISED_DateTime">

                     <d:timeZoneCode/>

                     <d:content>2014-01-10T20:02:08.8757980Z</d:content>

      </d:StartDateTime>

      Attachments

        Activity

          People

            mirbo mibo
            Priyanka_Bharti Priyanka Bharti
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 48h
                48h
                Remaining:
                Remaining Estimate - 48h
                48h
                Logged:
                Time Spent - Not Specified
                Not Specified