docs(openapi): pin PurchaseOrderHeader + Line field-length bounds (#304)#305
Merged
Merged
Conversation
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>
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 #304.
Summary
Mirrors the zod field-length caps into the OpenAPI component schemas for
PurchaseOrderHeaderandPurchaseOrderLine:pohReference: 1..255pohTerms: 1..1000polItemDesc: 1..1000Test plan
npm run lint && npm test— 772 passing (was 770), 2 new test cases intests/api/openapi.test.js.Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/