Skip to content

Feature: machine-readable output (--json) #45

Description

@korya

Problem

Output is human-formatted prose on stderr only. There is no structured form, so a CI job or monitoring agent that wants to know which assertion failed has to scrape:

Error: Cannot perform request: 4 assertions failed:
- ok: expected OK, got 500 ("500 Internal Server Error")
- status: expected 200, got 500 ("500 Internal Server Error")
- header[X-Nope]: expected "1", missing
- body: expected "zzz", got "boom"

Proposed

--json   Emit a machine-readable result document on stdout

Roughly:

{
  "url": "http://…/500",
  "method": "GET",
  "status": 500,
  "duration_ms": 0.51,
  "passed": false,
  "assertions": [
    {"kind": "ok",     "passed": false, "expected": "2xx-3xx", "actual": 500},
    {"kind": "status", "passed": false, "expected": 200,       "actual": 500}
  ]
}

Why it matters

Enables dashboards, alert payloads, and JUnit-style conversion for CI reporting. Pairs naturally with the stdout/stderr split requested separately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions