Documentation

JSON output for CI and services

Result, PDFError and Check marshal to a stable JSON shape — the same shape the CLI emits under --json.

Result, PDFError and Check marshal to a stable JSON shape, for CLI, service, or CI integration. The command-line tool emits the same shape under --json.

json.go
// Result, PDFError and Check marshal to a stable JSON shape,
// for CLI, service, or CI integration.
b, err := json.Marshal(v)

// {"type":"A-1b","valid":false,"issueCount":2,"issues":[
//   {"check":{"name":"...","clause":"6.1.3",...},
//    "page":0,"documentLevel":true,"messages":["..."],"text":"..."}]}

“Stable” is the operative word: the shape is treated as part of the public API, so a report written by one version stays parseable by tooling built against another. That is what makes it safe to store validation results alongside archived documents, which is the usual reason anyone wants JSON here in the first place.

Because the library and the CLI emit the same structure, you can prototype against the command line and move to the library later without rewriting whatever consumes the output.