Quantcast
Channel: SCN : Popular Discussions - RESTful Web Services SDK
Viewing all articles
Browse latest Browse all 1088

RESTful JSON Inconsistencies by Design?

$
0
0

I am working my way into using the BusinessOBjects RESTful web services.  I have a Java application and i am using the GSON library (form Google) to convert JSON returned from BusinessObjects RESTful web services into Java Objects.  GSON requires that the Java Class be defined upfront so it knows how to convert the JSON to the Java Object.  Unfortunately I am finding simple inconsistencies between to resultant JSON from the BusinessObjects RESTful web services depending on if the there is one or more core entities.  Sound confusing?  Let me explain:

 

Using the '<base url>/infostore' RESTful call returns JSON that contains a core object of 'entities' which are the infostore objects.  It does not matter if there is zero, one or more than one entities returned, the 'entities' object in the JSON is always an array[].  However, this is not the case with '/reports' and '/dataproviders'.  If a document has only one Report Tab or Data Provider, the core object 'report' or 'dataprovider' object in the JSON will NOT be an array.  It will only be an array if there is more than one Report Tab or Data Provider.  This is a problem because it is inconsistent with the '/infostore' call and forces me to determine upfront (if i can at all) if the JSON returns an array or not before attempting to convert it to a Java Object.

 

Has anyone else noticed this?  Is this by design?  Do you have a nice solution on how to get around this?  If this is NOT by design, is it fixed in a patch?

 

Any help would be appreciated!

 

Thanks! ~ Mickey Grackin


Viewing all articles
Browse latest Browse all 1088

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>