JSON serialization attributes (json.Serializer)

Important:

These serializer-specific attributes are supported only by json.Serializer and do not work with util.JSON.

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.