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 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

In this example, the allowNullAsDefault option is set to allow nulls. For more details, go to Example 1: JSON to BDL deserialization options to allow nulls

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