JSON Serialization Attributes

Here’s the list of attributes that affect JSON serialization. They should be properly supported by all target languages.

Attribute

Type

Inheritance

Target

Description

Default

json.enabled

bool

scope

module,
type
generate JSON serialization
code for target language

false

json.ignore

bool

record field
exclude record field from JSON
serialization

false

json.field_notation

Notation

scope

module,
type,
record field
enum field
Notation used for name
translation of record and
enum field names into JSON
strings

none

json.notation

Notation

scope

module,
type,
service
Notation used for name
translation of service
functions and exception names
into JSON strings

none

json.key

string

enum field,
record field
Override record and enum field
names (and ignore notation)

json.number

bool

module
enum
Serialize enums as numbers
instead of strings

false

json.nulls

bool

scope

module
record
Include unset optional field
values as nulls

patch_record

bool

record

See Patch Records

false