From c5c160fbd760b5988589085a03a313f59a6f5e07 Mon Sep 17 00:00:00 2001 From: "Aaron K. Clark" Date: Tue, 19 May 2026 09:57:36 -0500 Subject: [PATCH] docs(openapi): pin Worker schema field lengths to match the validators Same pattern as the customer fix (#270) and company fix (#272). \`worker.schema.js\` validates workerFName / workerLName / workerTitle each as \`z.string().min(1).max(255)\`. The OpenAPI Worker component had them as bare \`type: 'string'\` with no bounds; SDK generators (openapi-typescript et al.) couldn't surface the constraint, so clients generated from the spec missed the minimum-1-char floor and the 255-char ceiling. Set \`minLength: 1, maxLength: 255\` on each name field. No behavior change. 760 tests still pass. Co-Authored-By: Claude Opus 4.7 (1M context) --- app/config/openapi.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/config/openapi.js b/app/config/openapi.js index c3ff0d9..d2c8f44 100644 --- a/app/config/openapi.js +++ b/app/config/openapi.js @@ -61,9 +61,14 @@ const workerSchema = { type: 'object', properties: { workerId: { type: 'integer', readOnly: true }, - workerFName: { type: 'string' }, - workerLName: { type: 'string' }, - workerTitle: { type: 'string' }, + // Lengths mirror worker.schema.js's zod validators + // (min(1).max(255) on the three name fields). Pinning them + // here lets openapi-typescript et al. carry the bounds into + // client-side types. Same pattern as Customer (#270) and + // Company (#272). + workerFName: { type: 'string', minLength: 1, maxLength: 255 }, + workerLName: { type: 'string', minLength: 1, maxLength: 255 }, + workerTitle: { type: 'string', minLength: 1, maxLength: 255 }, workerDefaultBillType: { type: 'integer' }, workerCompId: { type: 'integer' }, workerArch: { type: 'boolean', readOnly: true },