Skip to content

Parse JSON

Parses JSON text into native Data.

@lainstack/data/parse-json · Data

Parse JSON turns one JSON text into native Data under value. The output has no declared field types. To get typed downstream references, follow it with @lainstack/data/apply-shape.

Choose it when a block gives you JSON as text. Do not use it for CSV files (use @lainstack/csv/parse). Do not use it to read values out of data that is already a record or list; reference those paths directly.

Traps:

  • The parser is strict. It accepts one JSON value only. No comments, trailing commas, or text after the value.
  • Text longer than 10,000 characters fails. Lists and records hold at most 100 items or fields. Nesting is at most 32 levels and the whole value at most 4,096 nodes.
  • Duplicate keys fail instead of keeping the last one.
  • A number that would lose precision fails, for example an integer above the safe integer range. Large identifiers must arrive as JSON strings.
  • A syntax error fails the step with json_syntax_invalid and the line and column. A limit or value problem fails with json_value_invalid. Neither retries.
  • text must be a text value. A record or list is invalid config.
Setting Key Type Details
Text (required) text Text Parse one strict JSON value into native Data.
Output Path Type
Value value Value