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).
56 lines
1.4 KiB
YAML
56 lines
1.4 KiB
YAML
info:
|
|
name: Sync Bookmarks
|
|
type: http
|
|
seq: 9
|
|
|
|
http:
|
|
method: POST
|
|
url: '{{base_url}}/api/sync/koreader/bookmarks'
|
|
auth: inherit
|
|
body:
|
|
type: json
|
|
data: |-
|
|
{
|
|
"book_sha256": "64-hex-char-sha256",
|
|
"bookmarks": [
|
|
{
|
|
"chapter": 3,
|
|
"datetime": "2026-08-20T10:00:00Z",
|
|
"pos0": "/body/Doc[4]/Sec[2]",
|
|
"page": 25,
|
|
"text": "",
|
|
"type": "bookmark",
|
|
"percentage": 0.125
|
|
}
|
|
],
|
|
"highlights": [
|
|
{
|
|
"datetime": "2026-08-20T10:05:00Z",
|
|
"pos0": "/body/Doc[4]/Sec[2]/text()[3]:0",
|
|
"pos1": "/body/Doc[4]/Sec[2]/text()[3]:42",
|
|
"text": "Text to remember",
|
|
"notes": "Why this matters",
|
|
"type": "highlight",
|
|
"color": "blue",
|
|
"dedup_key": "echo-key-from-server"
|
|
}
|
|
]
|
|
}
|
|
headers:
|
|
- key: Authorization
|
|
value: Bearer {{device_token}}
|
|
settings:
|
|
encodeUrl: true
|
|
timeout: 0
|
|
followRedirects: true
|
|
maxRedirects: 5
|
|
|
|
docs:
|
|
content: |-
|
|
# Sync Bookmarks
|
|
|
|
`POST /api/sync/koreader/bookmarks` — auth: device-token.
|
|
|
|
Canonical reference: docs/developer/api/koreader/sync_bookmarks.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
|
|
type: text/markdown
|