Skip to content

docs(openapi): bulk endpoints + Idempotency-Key + /metrics now in spec#89

Merged
CryptoJones merged 1 commit into
masterfrom
docs/openapi-bulk-metrics-idempotency
May 18, 2026
Merged

docs(openapi): bulk endpoints + Idempotency-Key + /metrics now in spec#89
CryptoJones merged 1 commit into
masterfrom
docs/openapi-bulk-metrics-idempotency

Conversation

@CryptoJones
Copy link
Copy Markdown
Owner

Summary

  • All 13 bulk-create endpoints now documented in app/config/openapi.js (was: just /v1/customer/bulk). Shared bulkPath() helper avoids 12 hand-maintained near-duplicates.
  • Idempotency-Key header documented as an optional parameter on every bulk POST.
  • /metrics Prometheus endpoint documented (text-format response, optional bearer-token gate).

Test plan

  • 3 new OpenAPI cases pin the additions.
  • Full suite: 472 pass / 4 skip.
  • Lint clean.

This code proudly made in Nebraska. GO BIG RED! 🌽 https://xkcd.com/2347/

Three gaps in `app/config/openapi.js` against the live API surface,
filled in:

1. **All 13 bulk-create endpoints documented**, not just
   `/v1/customer/bulk`. Customer/bulk predates the helper, so it
   keeps its bespoke entry; the other 12 are factored through a
   shared `bulkPath(bodyKey, schemaName)` function so the spec
   doesn't grow 12 hand-maintained near-duplicates. Each describes
   the 500-entry cap, the all-or-nothing transactional semantics,
   and the 201/400/403/409/500 response codes.

2. **Idempotency-Key header** documented as a reusable parameter
   on every bulk POST that flows through `bulkPath()`. Says the
   header is optional, format is printable ASCII 1-255 chars, and
   explains the replay-vs-409-on-mismatch behavior.

3. **`/metrics` endpoint** gets its own path entry: Prometheus
   text-format response, the optional `METRICS_BEARER_TOKEN`
   bearer-auth gate, and the 200/401 response codes.

Tests
- `tests/api/openapi.test.js` gains 3 new cases pinning the
  additions: 13-bulk-paths-present, Idempotency-Key-on-worker-bulk,
  /metrics-present.
- Full suite: 472 pass / 4 skip (was 469/4).
- Lint clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@CryptoJones CryptoJones merged commit d02c26e into master May 18, 2026
3 checks passed
@CryptoJones CryptoJones deleted the docs/openapi-bulk-metrics-idempotency branch May 18, 2026 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant