json.Serializer.setOption

Enables setting global options for the JSON serializer.

Syntax

json.Serializer.setOption(
   name STRING,
   value INTEGER )
  1. name is the name of a JSON serializer option of type STRING.
  2. value is an INTEGER.

Usage

Use this method to configure global options for the JSON serializer.

In case of error, the method throws an exception and sets the status variable. Depending on the error, a human-readable description of the problem is available in the sqlca.sqlerrm register. See Error handling in GWS calls (status).

Example: Set allowNullAsDefault

Set the allowNullAsDefault option to 1, allowing NULL values to be accepted during deserialization even if the json_null="null" attribute is not explicitly specified. By default, allowNullAsDefault is 0.

IMPORT json
MAIN
    CALL json.Serializer.setOption("allowNullAsDefault",1)
    #...
END MAIN