Skip to content

docs(openapi): Idempotency-Key parameter on all 16 single-POST endpoints#98

Merged
CryptoJones merged 1 commit into
masterfrom
docs/openapi-idem-on-single-posts
May 18, 2026
Merged

docs(openapi): Idempotency-Key parameter on all 16 single-POST endpoints#98
CryptoJones merged 1 commit into
masterfrom
docs/openapi-idem-on-single-posts

Conversation

@CryptoJones
Copy link
Copy Markdown
Owner

Follow-up to #89.

Summary

  • The Idempotency middleware applies to every /v1/* POST, but the OpenAPI spec only documented the header on bulk endpoints.
  • 16 single-POST entries gain parameters: [idempotencyKeyHeader]. Code-generators reading the spec can now produce SDK methods that accept the header on single creates too.
  • The 409 response is NOT added on single POSTs — same-key-different-body is rare enough that documenting just the request header is sufficient. Bulk POSTs keep their existing 409 doc.

Test plan

  • New OpenAPI case pins the header on all 16 single-POST entries.
  • Full suite: 479 pass / 4 skip.
  • Lint clean.

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

The middleware applies to every /v1/* POST, but the OpenAPI spec
previously only documented the header on the bulk variants (via
the bulkPath() helper). SDK code-generators reading the spec saw
single-create POSTs as non-idempotent, even though clients could in
fact send Idempotency-Key safely.

16 single-POST entries gain `parameters: [idempotencyKeyHeader]`:
customer, timeentry, worker, billingtype, inventoryitem, company,
job, invoice, customerpayment, invoicejob, productentry,
versioninfo, purchaseordervendor, purchaseorderheader,
purchaseorderline, inventorytransaction.

We don't add a `409` response code on the single POSTs — the
same-key-different-body case is rare enough that just documenting
the request header is sufficient for code-gen. The bulk variants
keep their 409 doc (bulkPath() helper, unchanged).

Tests: new OpenAPI assertion (1 case, 16 expectations) pins the
Idempotency-Key header is present on each single-POST.
Full suite: 479 pass / 4 skip (was 478/4).
Lint clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@CryptoJones CryptoJones merged commit 3003838 into master May 18, 2026
3 checks passed
@CryptoJones CryptoJones deleted the docs/openapi-idem-on-single-posts branch May 18, 2026 05:57
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