Skip to main content

Module decode

Module decode 

Source
Expand description

Response-decode pipeline (#515).

A declarative chain applied to the raw response body before record extraction, so a source can consume payloads that aren’t plain JSON — including files embedded in a JSON/SOAP envelope:

decode:
  - extract: "runReportResponse.runReportReturn.reportBytes"  # element text out of the SOAP body
  - base64                               # base64 → bytes
  - unzip: { member: "*.csv" }           # or `gunzip`
  - parse: { format: xlsx, header_row: 4 }

Steps compose left-to-right over a byte buffer; the terminal parse step turns the bytes into records. Without an explicit parse, the bytes are parsed as JSON.

Note: unlike the REST source’s decode pipeline, the XML source’s extract step selects an element’s text by a dot-path (namespace-insensitive, trailing-match) rather than a JSONPath — the body here is XML/SOAP.

Structs§

ParseSpec
Parse the decoded bytes into records.
UnzipSpec
Select a member of a zip archive.

Enums§

DecodeStep
One step of the decode chain.
ParseFormat
Final-parse format for a decode chain.
SimpleStep
A byte-chain step with no parameters (- base64, - gunzip).

Functions§

run_decode
Run the decode chain over the response body, returning records.