docs(openapi): bulk endpoints + Idempotency-Key + /metrics now in spec#89
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
app/config/openapi.js(was: just/v1/customer/bulk). SharedbulkPath()helper avoids 12 hand-maintained near-duplicates.Idempotency-Keyheader documented as an optional parameter on every bulk POST./metricsPrometheus endpoint documented (text-format response, optional bearer-token gate).Test plan
This code proudly made in Nebraska. GO BIG RED! 🌽 https://xkcd.com/2347/