json.Serializer.setOption
Sets an option on the JSON serializer.
Syntax
setOption(
name STRING,
value INTEGER )
- name is the name of a JSON serializer option of type
STRING. - value is an
INTEGER.
Usage
Use this method to configure options for the JSON serializer. For a list of available options and their values, see json.Serializer options.
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 Deserializing JSON nulls with allowNullAsDefault.
IMPORT json
MAIN
CALL json.Serializer.setOption("allowNullAsDefault",1)
#...
END MAIN
For examples setting the serializeNullAsDefault option, go to Serializing JSON nulls with serializeNullAsDefault.