feat(errors): Error400.details.errors[] array for multi-field validation - #763
feat(errors): Error400.details.errors[] array for multi-field validation#763ls-bolt[bot] wants to merge 1 commit into
Conversation
Replace singular `details.field`/`details.constraint` with a typed
`details.errors[]` array so submit endpoints (POST /customers, PATCH
/customers/{id}) can report every invalid field in one round-trip.
Adds `FieldError` schema — one entry per invalid field, carrying
`field` (dot-notation path), optional `constraint` (FieldConstraint —
the existing machine-readable validator hint), and optional `message`
(human-readable explanation).
Backwards-incompatible change to `Error400.details`: the singular
`field` and `constraint` properties are removed. Approved per
lightsparkdev/webdev#31110 review — no consumers of the previous shape
had wired it into production yet.
Consumers of this shape land in webdev#31110.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
✱ Stainless preview builds for gridThis PR will update the cli go kotlin openapi php python ruby typescript Edit this comment to update them. They will appear in their respective SDK's changelogs. ✅ grid-typescript studio · code · diff
✅ grid-openapi studio · code · diff
✅ grid-ruby studio · code · diff
✅ grid-go studio · code · diff
✅ grid-kotlin studio · code · diff
✅ grid-python studio · code · diff
✅ grid-php studio · code · diff
✅ grid-cli studio · code · diff
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
…ion (#764) ## Summary Replaces singular `details.field` + `details.constraint` on `Error400` with a typed `details.errors[]` array so submit endpoints (`POST /customers`, `PATCH /customers/{id}`) can report every invalid field in one round-trip. ## Motivation The consumer implementation on the sparkcore side (webdev#31110) iterates all pydantic errors and emits one entry per invalid field. The spec previously only surfaced the first as machine-readable — platform integrators would have to re-submit and see the next one on each round-trip. The array shape lets them render form-field-level UX for the whole request in one shot. ## Changes: 4 files - `openapi/components/schemas/errors/FieldError.yaml` — new schema: `{field: required string, constraint?: FieldConstraint, message?: string}`. One entry per invalid field. - `openapi/components/schemas/errors/Error400.yaml` — `details` now has `errors: array` of `FieldError`; drops the singular `field` and `constraint` properties. - `openapi.yaml` + `mintlify/openapi.yaml` — regenerated bundles (`make build`). ## Breaking change `details.field` and `details.constraint` are removed at the top level of `details`. Approved per [lightsparkdev/webdev#31110](lightsparkdev/webdev#31110) review — no external consumers had wired the previous shape into production yet, so this is safe to change in place. Skipping the `info.version` bump on that basis; happy to add one if reviewers prefer. ## Downstream consumer The sparkcore side lives in [lightsparkdev/webdev#31110](lightsparkdev/webdev#31110). After this lands, that PR will regenerate the grid-api Python client and drop its backwards-compat singular field/constraint carriage on `GridException`. Requested by @akanter Original PR: #763

Summary
Replaces singular
details.field+details.constraintonError400with a typeddetails.errors[]array so submit endpoints (POST /customers,PATCH /customers/{id}) can report every invalid field in one round-trip.Motivation
The consumer implementation on the sparkcore side (webdev#31110) iterates all pydantic errors and emits one entry per invalid field. The spec previously only surfaced the first as machine-readable — platform integrators would have to re-submit and see the next one on each round-trip. The array shape lets them render form-field-level UX for the whole request in one shot.
Changes: 4 files
openapi/components/schemas/errors/FieldError.yaml— new schema:{field: required string, constraint?: FieldConstraint, message?: string}. One entry per invalid field.openapi/components/schemas/errors/Error400.yaml—detailsnow haserrors: arrayofFieldError; drops the singularfieldandconstraintproperties.openapi.yaml+mintlify/openapi.yaml— regenerated bundles (make build).Breaking change
details.fieldanddetails.constraintare removed at the top level ofdetails. Approved per lightsparkdev/webdev#31110 review — no external consumers had wired the previous shape into production yet, so this is safe to change in place.Skipping the
info.versionbump on that basis; happy to add one if reviewers prefer.Downstream consumer
The sparkcore side lives in lightsparkdev/webdev#31110. After this lands, that PR will regenerate the grid-api Python client and drop its backwards-compat singular field/constraint carriage on
GridException.Requested by @akanter