docs(openapi): declare bulkPath() 201 envelope for 12 factory endpoints (#352)#353
Merged
Merged
Conversation
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>
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.
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.jswalks 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/