serialize

Intended to serialize structured data into several string representations.

Parameters

Name Type Constraints Meaning
format string optional Serialization format. CSV and YAML are supported.
input any required Data to serialize.

Return Values

Name Type Meaning
serialized string The resulting serialized string.

Example Usage

getDataSomehow:
  action: ...
  output:
    data-to-serialize: ...
serializeSomething:
  action: serialize
  parameters:
    format: CSV
    input: '{$.data-to-serialize}'
  output:
    serialized-data: serialized

CSV Rules

When serializing data structures to CSV, the following rules apply:

  • Lists with scalar contents are represented as rows with a single column.
  • Lists containing other lists are represented as rows with several columns
  • Maps of scalars are represented as rows with two columns: keys and values