Skip to content

docs(openapi): declare bulkPath() 201 envelope for 12 factory endpoints (#352)#353

Merged
CryptoJones merged 1 commit into
masterfrom
docs/openapi-bulkpath-response-shape
May 19, 2026
Merged

docs(openapi): declare bulkPath() 201 envelope for 12 factory endpoints (#352)#353
CryptoJones merged 1 commit into
masterfrom
docs/openapi-bulkpath-response-shape

Conversation

@CryptoJones
Copy link
Copy Markdown
Owner

Closes #352.

Summary

Same envelope-drift fix as #332 (customer/bulk), now applied at the factory level so all 12 factory-driven bulk endpoints inherit the content schema in one commit.

Sweep test in tests/api/openapi.test.js walks all 12 paths and asserts the shape.

Test plan

  • npm run lint && npm test — 794 passing (was 793).

Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/

The bulkPath() factory in `app/config/openapi.js` generates the spec
entries for the 12 entities that go through `_bulk-helpers`
(worker, billingtype, inventoryitem, inventorytransaction,
purchaseordervendor, job, invoice, customerpayment, invoicejob,
productentry, purchaseorderheader, purchaseorderline). Every one of
those endpoints had a 201 response declaration with description +
the Idempotency-Replay header but NO content schema — same drift
fixed for customer/bulk in #332.

The controllers (`makeBulkCreate` / `makeBulkCreateIndirect`) emit:

    { message, count, [bodyKey]: <created rows> }

…where the array key matches the request's bodyKey. Update the
factory to declare that envelope once; all 12 endpoints inherit
the fix.

Add a sweep test in `tests/api/openapi.test.js` that walks the 12
factory-driven paths and pins (message, count, [bodyKey] →
$ref schemaName) on each. One test, 12 assertions per — any of
the 12 regressing fails CI together.

Test count: 793 → 794.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@CryptoJones CryptoJones merged commit 49e24c3 into master May 19, 2026
3 checks passed
@CryptoJones CryptoJones deleted the docs/openapi-bulkpath-response-shape branch May 19, 2026 19:27
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.

OpenAPI: bulkPath() factory emits 201 with no content schema (12 endpoints)

1 participant