Skip to content

Serialization and Deserialization

XIDL supports modifying serialization and deserialization behavior through annotations.

AnnotationActionScope
@rename(“new_name”)Rename a parameter or fieldMethod parameters, struct fields
@rename_all(“rule”)Bulk rename parameters or fieldsMethod parameters, struct fields
@skipSkip serialization/deserialization of a fieldStruct fields

The @rename_all annotation allows bulk renaming of method parameters or struct fields. Supported naming rules include:

  • None
  • lowercase
  • UPPERCASE
  • PascalCase
  • camelCase
  • snake_case
  • SCREAMINGSNAKECASE
  • kebab-case
  • SCREAMING-KEBAB-CASE

Parameter Encoding Method

Single-parameter Input Flattened Encoding Method

Section titled “Single-parameter Input Flattened Encoding Method”

Flatten Encoding Method

Return Value Encoding Method

Multi-return Value Encoding Method