json.Serializer attributes

Important:

Most of the attributes in this table apply only to json.Serializer. Attributes that also work with util.JSON, such as json_name and json_null, are identified in their descriptions.

Table 1. JSON attributes
Attribute Description
JSONAdditionalProperties = { true | false } 
Specify a record that can have properties whose names are not listed in the definition.
JSONAllOf
Combine multiple record schemas into a single type using the JSONAllOf attribute in Genero BDL.
 JSONEnum  = '{ "enum-value" } [,...]'
Defines an explicit, typed list of acceptable values for a field and maps to the enum keyword in JSON Schema.
JSONOneOf
Defines a record that must match exactly one of several possible JSON schemas during serialization or deserialization. Used to handle polymorphic JSON structures where multiple schema definitions may apply.
JSONSelector
Specify which record member set with JSONOneOf needs to be serialized or deserialized.
JSONPattern = "pattern"
Specify a regular expression pattern for string values in a JSON schema.
JSONRequired
Specify properties that are required in a JSON schema.
json_null = {"null" | "undefined"}
This attribute controls the representation of null or empty values. json.Serializer uses it during both serialization and deserialization, but util.JSON applies it only when serializing.
json_name="JSON element name"
This attribute maps a BDL variable to a JSON element name that cannot be represented as a valid BDL identifier, including names with spaces or special characters. This attribute is supported by both json.Serializer and util.JSON.