Skip to main content

Array Serialization Formats in Java and Android

· One min read

Multiple formats are now supported for Array serialisation in form and query parameters. Formats supported include UnIndexed, Indexed, Plain, CSV, PSV, TSV.

This settings can be set using our API Blueprint CodeGen setting extension named ARRAYSERIALIZATION.

Details: Format and examples

  • UnIndexed: bussinessAsset[]=1&bussinessAsset[]=2
  • Indexed: bussinessAsset[1]=1&bussinessAsset[2]=2
  • Plain: bussinessAsset=1&bussinessAsset=2
  • CSV: bussinessAsset=1,2 (Only for query parameters)
  • PSV: bussinessAsset=1|2 (Only for query parameters)
  • TSV: bussinessAsset=1\t2 (Only for query parameters)

These array serialization formats are also supported in C# and AngularJS.

Benefits

Different APIs can expect array values to be serialized in different formats (such as CSV, TSV etc). No matter which format the API expects, our SDKs will automatically serialize and deserialize array payload in the correct format.

Array Serialization implementation helps you:

  • Use array values the way you normally would in your language, independent of the format that the API expects
  • Focus on the business logic of the application without worrying about serialization/deserialization of array payload
  • Support for 6 widely used array serialization formats