Skip to content

feat(errors): Error400.details.errors[] array for multi-field validation - #763

Closed
ls-bolt[bot] wants to merge 1 commit into
mainfrom
07-29-error400-errors-array
Closed

feat(errors): Error400.details.errors[] array for multi-field validation#763
ls-bolt[bot] wants to merge 1 commit into
mainfrom
07-29-error400-errors-array

Conversation

@ls-bolt

@ls-bolt ls-bolt Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

This PR has been claimed. The active PR is now #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.yamldetails 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 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. 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

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.
@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
grid-flow-builder Ignored Ignored Preview Jul 29, 2026 6:51am
grid-wallet-demo Ignored Ignored Preview Jul 29, 2026 6:51am

Request Review

@ls-bolt ls-bolt Bot added the bolt label Jul 29, 2026

akanter commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

✱ Stainless preview builds for grid

This PR will update the grid SDKs with the following commit messages.

cli

chore(internal): regenerate SDK with no functional changes

go

chore(internal): regenerate SDK with no functional changes

kotlin

chore(internal): regenerate SDK with no functional changes

openapi

feat(api): add FieldError model and errors array to Error422 details

php

chore(internal): regenerate SDK with no functional changes

python

chore(internal): regenerate SDK with no functional changes

ruby

chore(internal): regenerate SDK with no functional changes

typescript

chore(internal): regenerate SDK with no functional changes

Edit this comment to update them. They will appear in their respective SDK's changelogs.

grid-typescript studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅build ⏭️ (prev: build ✅) → lint ⏭️ (prev: lint ❗) → test ✅

grid-openapi studio · code · diff

Your SDK build had at least one "warning" diagnostic, but this did not represent a regression.
generate ⚠️

grid-ruby studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅build ⏭️ (prev: build ✅) → lint ✅test ✅

grid-go studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅build ⏭️ (prev: build ✅) → lint ❗test ❗

go get github.com/stainless-sdks/grid-go@0bdabe0d457f7a8cc1b8eb1f6ef3a9c5ebbaa7b7
grid-kotlin studio · code · diff

Your SDK build had at least one "warning" diagnostic, but this did not represent a regression.
generate ⚠️build ⏭️ (prev: build ✅) → lint ⏭️ (prev: lint ✅) → test ❗

grid-python studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅build ⏭️ (prev: build ✅) → lint ⏭️ (prev: lint ❗) → test ❗

grid-php studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅lint ✅test ✅

grid-cli studio · code · diff

Your SDK build had at least one "warning" diagnostic, but this did not represent a regression.
generate ⚠️build ❗lint ❗test ❗


This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
If you push custom code to the preview branch, re-run this workflow to update the comment.
Last updated: 2026-07-29 06:55:02 UTC

@mintlify

mintlify Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
Grid 🟢 Ready View Preview Jul 29, 2026, 6:52 AM

@mintlify

mintlify Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
Grid 🟡 Building Jul 29, 2026, 6:51 AM

@akanter akanter closed this Jul 29, 2026
akanter added a commit that referenced this pull request Jul 29, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant