REST API throwing "Json document specified in request body is not valid!" after upgrading to VMware GemFire 9.9
search cancel

REST API throwing "Json document specified in request body is not valid!" after upgrading to VMware GemFire 9.9

book

Article ID: 294362

calendar_today

Updated On:

Products

VMware Tanzu Gemfire

Issue/Introduction

REST API calls that worked previously to VMware GemFire 9.9 are throwing "Json document specified in request body is not valid!" after upgrading to VMware GemFire 9.9.

The following code to generate JSON for the REST API works before VMware GemFire 9.9:
StringEntity parameters = new StringEntity("[{\"@type\":\"java.util.HashMap\",\"identifier\":\" + id_value +\"}]");


Environment

Product Version: 9.9

Resolution

In VMware GemFire 9.9 the general parsing/processing was changed to use Jackson for JSON. Jackson for JSON is stricter in the validation of JSON which means that Strings must be quoted to be valid JSON. The code above must be changed to quote the id_value variable as shown below:
StringEntity parameters = new StringEntity("[{\"@type\":\"java.util.HashMap\",\"identifier\":\"" + id_value + "\"}]");