JSON

This connector is used to read local JSON files.

Connection configuration

No connection is required by this connector.

Test case configuration

NameMandatoryDefaultDescription
pathyesPath to the JSON file
linesnofalseWhether to treat the file as line-delimited JSON (one JSON object per line)
nrowsnoNumber of lines to read (line-delimited mode only)
encodingnoutf-8Encoding to use when reading the file

Example

Example JSON:
  source:
    type: json
    path: ./data/employees.json
  expected:
    type: csv
    path: ./data/expected_employees.csv

Example with line-delimited JSON

Example JSONL:
  source:
    type: json
    path: ./data/events.jsonl
    lines: true
    nrows: 1000
  expected:
    type: empty