json.Serializer.getOption

Returns the value of a JSON serializer global option.

Syntax

json.Serializer.getOption(
   name STRING) RETURN INTEGER
  1. name is the name of an option of the JSON serializer of type STRING.

Usage

Use this method to return values of global options set 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: Get allowNullAsDefault

Return the value of the allowNullAsDefault option. If the value is 1, then NULL values are accepted during deserialization even if the JSON type is not explicitly specified. By default, allowNullAsDefault is 0.

IMPORT json
DEFINE isAllowNullAsDefault INTEGER
MAIN
    DISPLAY json.Serializer.getOption("allowNullAsDefault")
    VAR isAllowNullAsDefault = json.Serializer.getOption("allowNullAsDefault")
    #...
END MAIN