json.Serializer options

Options for controlling serialization and deserialization behavior, set using the json.Serializer class.

Global options

Important:

These options apply to all JSON write paths and affect both json.Serializer and json.JSONWriter. They do not work with util.JSON; to configure equivalent serialization modes for util.JSON, use util.JSON.setDatetimeSerializationMode and util.JSON.setIntervalSerializationMode.

Table 1. Global options
Option Description Affects
datetimeSerializationMode = value
Controls the JSON output format for DATETIME values during serialization. Serialization (BDL to JSON)
intervalSerializationMode = value
Controls the JSON output format for INTERVAL values during serialization. Serialization (BDL to JSON)

Serializer-specific options

Important:

These options are supported only by json.Serializer and do not work with json.JSONWriter or util.JSON.

Table 2. Serializer-specific options
Option Description Affects
allowImplicitConversion = value
Allow implicit type conversions during JSON deserialization when the JSON property specifies one type, but the values suggest another. Deserialization (JSON to BDL)
allowNullAsDefault = value
Allow NULL values to be accepted during deserialization when the json_null="null" attribute is not explicitly specified. Deserialization (JSON to BDL)
serializeNullAsDefault = value
Allow NULL values during serialization even when constraints are set, such as when JSONRequired is defined or when json_null="null" is not defined. Serialization (BDL to JSON)