Fenced JSON
Validate literal request and response payloads, with optional metadata right on the fence.
01 Contract-aware documentation
Lint the JSON and curl snippets humans actually copy. One small CI gate connects Markdown, OpenAPI, and clear line-level fixes.
cargo install --git github.com/…/sf-api-example-linter
Shell-safe curl is parsed, never run
Offline-first remote refs stay off
CI-native precise annotations
02 The shortest path to trustworthy docs
No fixture migration. Point the linter at the documentation you already maintain and choose the operation or schema that gives each block meaning.
Find fenced JSON and curl bodies in Markdown, plus examples embedded in OpenAPI 3.x.
docs/**/*.mdResolve the operation or named schema, including local references and request/response direction.
operation=createPetReturn the file, line, JSON pointer, and exact mismatch in text, JSON, or GitHub format.
$/tag · not allowed03 Recorded run
This recording uses the real CLI output contract. Nothing is uploaded, and playback begins only when you ask.
Ready to lint 2 examples.
Recording stopped at the first frame.
04 Small surface, useful coverage
Validate literal request and response payloads, with optional metadata right on the fence.
Extract JSON data flags as text. Never invoke a shell, source an environment, or follow a redirect.
Check media examples already inside 3.0 and 3.1 documents against their own operation schema.
05 Five-minute setup
Add one config file and one CI command. When a field drifts, the pull request points to the example that needs repair.
{
"spec": "openapi.yaml",
"inputs": ["docs"],
"operation": "createPet",
"direction": "request"
}
api-example-linter check --format github