Files
bookhoard/bruno/opencollection.yml
T
John O'Keefe cfcd95b25e bruno: replace Python generator with Go golden-writer in the drift test
The generator moves into the Go toolchain per repo preference:
internal/docs/bruno_gen.go emits the OpenCollection mirrors (same output
contract — gate-verified example-request bodies, env-var params,
device-token headers, login/register/refresh token-capture scripts) and
TestBrunoMirrorsDocs grows a -update flag: verification by default,
regeneration on demand:

  go test ./internal/docs -run TestBrunoMirrorsDocs -update

Generator and checker are now the same code — they cannot drift apart.
scripts/gen_bruno_from_docs.py deleted; opencollection.yml README points
at the go-test command.

Also fixed vs the Python pass: mirror placement follows the docs tree
folder (RelPath), not the area frontmatter (several docs — highlights,
notes, ratings, users, progress — carry a different area); docs blocks
emit the collection's mapping form (content + type), not a bare scalar;
JSON body sanity is checked at generation time.

Idempotent: back-to-back -update runs are byte-identical.
make test green (9 pkgs).
2026-10-24 18:47:56 -04:00

47 lines
1.3 KiB
YAML

opencollection: 1.0.0
info:
name: Bookhoard
config:
proxy:
inherit: true
config:
protocol: http
hostname: ""
port: ""
auth:
username: ""
password: ""
bypassProxy: ""
request:
auth:
type: bearer
token: "{{token}}"
docs:
content: |-
# Bookhoard API — executable verification (OpenCollection / Bruno)
Every request in this collection is GENERATED from the canonical API
docs (docs/developer/api/**). Do not hand-edit request files — edit
the doc, then regenerate:
go test ./internal/docs -run TestBrunoMirrorsDocs -update
Hand-authored exceptions (not generated):
- NewDevDBSetup/ — ordered dev-database bootstrap sequence
- */scenarios/, media-items/filters, media-items/search — edge-case suites
- environments/Bookhoard.yml — variables
Run order: NewDevDBSetup (RegisterUser captures {{token}}), then any
request. Device-token routes (kobo/koreader/opds) need {{device_token}}
or {{kobo_device_token}} in the environment.
The docs site (Developer → API) is the single source of truth for
shapes; internal/docs/drift_test.go enforces docs-to-routes and
docs-to-Bruno parity.
type: text/markdown
bundled: false
extensions: {}