Skip to content

JSON and NDJSON input and output format support #96

@vmvarela

Description

@vmvarela

Part of #68
Depends on #95 (format plugin architecture)

Description

Add JSON array-of-objects and newline-delimited JSON (NDJSON) as input and output formats. This generalizes the existing --json output flag into the new --output-format json system, and adds JSON as an input source.

Acceptance Criteria

  • --input-format json reads a JSON array of objects (each object becomes a row)
  • --input-format ndjson reads one JSON object per line
  • --output-format json produces a JSON array of objects (column names as keys)
  • --output-format ndjson produces one JSON object per line
  • Nested JSON objects in input are serialized as JSON strings (not flattened)
  • JSON arrays in input are serialized as JSON strings
  • Type detection: numbers, booleans, and null values are handled correctly
  • Malformed JSON produces a clear error with line number

Notes

  • JSON input flattening strategy: top-level keys only; nested values become JSON strings
  • The existing --json flag should map to --output-format json internally after Format plugin architecture for multi-format I/O #95
  • Consider using Zig's std.json for parsing

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:mediumShould be done soonsize:mMedium — 4 to 8 hoursstatus:readyRefined and ready for sprint selectiontype:featureNew functionality

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions