JSON Expected-Value Validator

Validate multiple JSON test cases in bulk against a schema and expected values defined in CSV.

Input data is processed in your browser
Data is never sent to a server

Tool

Validate multiple JSON test cases at once against a schema CSV and an optional expected-value CSV. Everything runs in your browser; nothing is sent to a server.

Columns: key (JSONPath), expected_type (string/number/boolean/array/object/null/any), required (true/false), compare_mode (exact/unordered/contains/length_only, optional)

Optional

Row 1: test_case_id, key1, key2, ... Following rows: expected value per test case. Leave a cell blank to only type-check that key. Omit this CSV entirely to only run type checks.

Drag & drop multiple .json files

With two or more files, the test_case_id in the expected-value CSV above must match the file name without the .json extension (e.g. package.json → package). With just one file, every row is validated against that single JSON regardless of its test_case_id.

Shows the JSON entered above as a tree. Click any key or value to generate its JSONPath, then add it straight into the schema CSV.

Hold Shift or Ctrl/Cmd while clicking to multi-select and get a common path suggestion across array elements.

"Copy jq command" lets you check the selected path from the terminal as a jq command (the file name is guessed from the case ID). It's disabled for path formats jq can't express, such as complex filter conditions.

No JSON is available to preview yet. Enter JSON above and it will appear here.

What is the JSON Expected-Value Validator?

The JSON Expected-Value Validator checks multiple JSON payloads at once against a schema (types and required fields) and expected values defined in CSV. It’s useful for regression-testing API responses or bulk-checking test fixtures across many scenarios.

Keys are specified with JSONPath, so you can use a wildcard like $.datalist[*].id to check every element of an array at once, or a filter predicate like $.datalist[?(@.id=="123")].title to target the value of one specific element regardless of its position.

How to Use

  1. Enter a schema CSV (columns: key, expected_type, required, compare_mode). The key column takes a JSONPath expression, including wildcards (`[*]`) and filter predicates (`[?(@.field=="value")]`).
  2. (Optional) Enter an expected-value CSV. Column 1 is test_case_id, the remaining columns are the expected value for each key. A blank cell only checks the type. Omit this CSV entirely to run type checks only.
  3. Provide the target JSON, either by uploading multiple .json files or pasting them directly as { "testCaseId": {...}, ... }.
  4. Click "Validate" to see a test case × key results matrix. Click any failing (mismatched) cell to see the expected vs. actual value.

FAQ

Can I use an Excel file (.xlsx) directly?

Not directly. Export it as CSV from Excel first ("Save As" → CSV). This keeps the tool lightweight and fully client-side, so only CSV is supported.

How do I specify expected values that are arrays or objects?

Write a JSON literal in the CSV cell, e.g. ["a","b","c"] or {"city":"Tokyo"}. Use the compare_mode column to choose exact (order matters), unordered (arrays compared ignoring order, the default), contains (partial match), or length_only.

How do I check just one specific item inside an array?

Use a JSONPath filter predicate, e.g. $.items[?(@.id=="123")].name. This locates the element by its content rather than its index, so the check keeps working even if the array's order or length changes.

Is my data sent to a server?

No. Reading the CSV/JSON and running the validation all happen entirely in your browser.