Skip to content

docs(openapi): pin PurchaseOrderHeader + Line field-length bounds (#304)#305

Merged
CryptoJones merged 1 commit into
masterfrom
docs/openapi-poheader-poline-field-lengths
May 19, 2026
Merged

docs(openapi): pin PurchaseOrderHeader + Line field-length bounds (#304)#305
CryptoJones merged 1 commit into
masterfrom
docs/openapi-poheader-poline-field-lengths

Conversation

@CryptoJones
Copy link
Copy Markdown
Owner

Closes #304.

Summary

Mirrors the zod field-length caps into the OpenAPI component schemas for PurchaseOrderHeader and PurchaseOrderLine:

  • pohReference: 1..255
  • pohTerms: 1..1000
  • polItemDesc: 1..1000

Test plan

  • npm run lint && npm test — 772 passing (was 770), 2 new test cases in tests/api/openapi.test.js.

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

The zod schemas for purchase-order headers and lines cap the
free-text fields:

  pohReference: 1..255 chars
  pohTerms:     1..1000 chars   (long-form "net 30, late fees…")
  polItemDesc:  1..1000 chars   (SKU + description on one line)

The OpenAPI component schemas declared them as bare `{ type: 'string' }`
with no length constraints. SDK generators reading the spec couldn't
see the server-side caps, so client-side validation couldn't catch
oversized payloads before they round-trip.

Add minLength/maxLength to PurchaseOrderHeader and PurchaseOrderLine
component schemas in `app/config/openapi.js`, and pin the new bounds
with two test cases in `tests/api/openapi.test.js` so future drift
on either side fails CI.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@CryptoJones CryptoJones merged commit 682ad25 into master May 19, 2026
3 checks passed
@CryptoJones CryptoJones deleted the docs/openapi-poheader-poline-field-lengths branch May 19, 2026 17:06
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: PurchaseOrderHeader + Line field-length bounds not pinned

1 participant