TRTH2 Extractions requiring ordered JSON object in body

https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/ExtractRaw

while sending the above request TRTH2 expects the request body to be an ordered Json object which is non conforming to the json libraries.

Is there an alternative which can be used apart from having a local customized json library ?

Best Answer

  • Christiaan Meihsl
    Answer ✓

    Currently it is necessary for the @odata.type (if included in the request) to be the first property in the object. The benefit of having it first is that it allows us to optimize the performance of our JSON serializer.

    How you achieve this depends on the programming language you use, but in some cases it does require using specific JSON libraries or objects. That is what we do in our Java samples, which use a JSONOrderedObject.