Move the API reference from the README to docs/api.md
Security / Vulnerability check (push) Successful in 38s
Test / Lint and test (push) Successful in 1m48s

docs/api.md holds the routes, elements, blocks, glyphs and error codes.
README keeps the overview, installing, configuration, the command line
and development, with a pointer to the API reference. The 0.1 migration
section is dropped; the changelog's Breaking entries cover the 0.1
changes.

Release archives include docs/api.md, and the 400 for a 0.1 job body
points to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
57_WolveandClaude Opus 5.5 committed 2026-11-30 08:49:21 -06:00
1 parent 15f63b6846
commit 9f7c5db923
9 files changed
+479 -488

No files matched your search

+2 -2
View File
@@ -74,7 +74,7 @@ func decodeValidJob(body []byte) (receipt.Job, error) {
// decodeJob strictly decodes a job body. Unknown fields are rejected so that
// typos fail loudly. A body with a top-level "data" key gets a message that
// points to "elements" and the README instead of the decoder's text.
// points to "elements" and the API reference instead of the decoder's text.
func decodeJob(body []byte) (receipt.Job, error) {
job, err := receipt.DecodeJob(body)
switch {
@@ -83,7 +83,7 @@ func decodeJob(body []byte) (receipt.Job, error) {
case err != nil:
msg := "request body is not a valid job: " + err.Error()
if strings.Contains(err.Error(), `unknown field "data"`) && hasTopLevelData(body) {
msg = `the {"data": [...]} format was replaced by {"elements": [...]}; see the README for the element format`
msg = `the {"data": [...]} format was replaced by {"elements": [...]}; see docs/api.md for the element format`
}
return job, newAPIError(codeInvalidJob.withMessage(msg))
}
@@ -732,7 +732,7 @@ func TestRoutesConform(t *testing.T) {
}
})
default:
t.Errorf("%s has no conformance case: add one here and a row to the README's API table", key)
t.Errorf("%s has no conformance case: add one here and a row to the API table in docs/api.md", key)
}
}
for key := range authenticated {