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
|
|
|
json.ignore |
bool |
record field
|
exclude record field from JSON
serialization
|
|
|
json.field_notation |
scope |
module,
type,
record field
enum field
|
Notation used for name
translation of record and
enum field names into JSON
strings
|
|
|
json.notation |
scope |
module,
type,
service
|
Notation used for name
translation of service
functions and exception names
into JSON strings
|
|
|
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
|
|
|
json.nulls |
bool |
scope |
module
record
|
Include unset optional field
values as nulls
|
|
patch_record |
bool |
record |
See Patch Records |
|