How to remove 'JSON Package Name' in the REST Web Service response in TIBCO Data Virtualization?

How to remove 'JSON Package Name' in the REST Web Service response in TIBCO Data Virtualization?

book

Article ID: KB0073937

calendar_today

Updated On:

Products Versions
TIBCO Data Virtualization All supported versions

Description

The published REST Web Services, by default, prepend the "Composite Service Name" as the JSON Package Name in their Operations responses in TIBCO Data Virtualization (TDV).
In the below example, "TestingRestServices" is the "Composite Service Name".  
 {"TestingRestServices.orderdetailsResponse": {"TestingRestServices.orderdetailsOutput": {"TestingRestServices.row":[ {"TestingRestServices.orderdetailid":1, "TestingRestServices.orderid":2, "TestingRestServices.productid":1, "TestingRestServices.quantity":3, "TestingRestServices.unitprice":89.99, "TestingRestServices.status":"open", "TestingRestServices.discount":0.10},
 
Note: The 'JSON Package Name' prepends to each element within the response record.
 
  

Issue/Introduction

How to remove 'JSON Package Name' in the REST Web Service response in TIBCO Data Virtualization?

Environment

All operating systems

Resolution

Follow the below steps to remove the 'JSON Package Name' from the result set:
User-added image
  1. Login to TDV studio as an admin user.
  2. Navigate to Modeler > Desktop (admin) > Composite Data Services > Web Services > TestingRestServices (Name of the composite that holds the REST service operation in the above example).
  3. Right-click and open the operation. On the bottom tabs, go to "REST".
  4. Under the "Service" panel, locate the 'JSON Package Name' as shown in the screenshot and remove its value.
  5. Save the changes.
Note:  A restart of the TDV server is not required.

Testing the same REST service operation returns the below response without the package name.
 {"orderdetailsResponse": {"orderdetailsOutput": {"row":[ {"orderdetailid":1, "orderid":2, "productid":1, "quantity":3, "unitprice":89.99, "status":"open", "discount":0.10},
 
  

Additional Information

https://docs.tibco.com/pub/tdv/8.3.0/doc/html/StudioHelp/index.html#page/StudioHelp/Ch_14_Publishing_Resources.Publishing%20a%20REST%20Service.html