Skip to content

[9/15] Document error responses in OpenAPI and refresh the TypeScript SDK snapshots - #162

Open
UnknownJoe796 wants to merge 3 commits into
version-5.3from
v53/openapi-sdk-docs
Open

[9/15] Document error responses in OpenAPI and refresh the TypeScript SDK snapshots#162
UnknownJoe796 wants to merge 3 commits into
version-5.3from
v53/openapi-sdk-docs

Conversation

@UnknownJoe796

Copy link
Copy Markdown
Contributor
  • Declared LSError cases now appear in the generated OpenAPI spec, not just
    the success response.
  • ModelRestEndpoints declares the errors it throws.
  • Refreshes the TypeScript SDK snapshots, which had drifted from the generator.

The snapshot files are generated output; regenerate rather than hand-edit. They
are regenerated again by the table-registration PR later in the stack, when the
models change.

@UnknownJoe796

Copy link
Copy Markdown
Contributor Author

Looks good.

@UnknownJoe796
UnknownJoe796 force-pushed the v53/docs-files-websockets branch from 4afc36f to 5bd3d6f Compare July 29, 2026 22:54
@UnknownJoe796
UnknownJoe796 force-pushed the v53/openapi-sdk-docs branch from c31622d to 6286e37 Compare July 29, 2026 22:54
UnknownJoe796 and others added 3 commits July 29, 2026 17:01
Typed endpoints declare errorCases (LSError with status/detail/message),
but only the success response was emitted. Emit each declared error case
as a documented response grouped by HTTP status, using the LSError
schema and an example, mirroring the success-response emission. Adds a
test confirming error responses and path parameters appear in the spec
(path parameters were already emitted at path-item level; the test locks
that in).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit 9a9c0ef)
(cherry picked from commit a2a3563)
Several auto-CRUD endpoints threw BadRequestException(detail="unique")
on unique-constraint violations and NotFoundException on upsert/replace
without declaring them, producing W6 "undeclared error" warnings at boot.
Add shared notFoundError (404) and uniqueViolationError (400, "unique")
LSError constants to the errorCases of every endpoint that throws them,
so the errors are documented and the warnings stop. Read-only endpoints
that never throw keep empty error lists. A test asserts each throwing
endpoint declares the error it can raise.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit acc5281)
(cherry picked from commit 69959ea)
The committed golden TS snapshots had drifted from the current generator.
Regenerating disambiguates nested type names (Mode -> UpdateRestrictions
Mode, Part -> UpdateRestrictionsPart), matching the generator's intended
output. Changes are confined to the type definitions and their imports.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit 22272fc)
(cherry picked from commit 6286e37)
@UnknownJoe796
UnknownJoe796 force-pushed the v53/docs-files-websockets branch from 5bd3d6f to d1b7d87 Compare July 30, 2026 02:19
@UnknownJoe796
UnknownJoe796 force-pushed the v53/openapi-sdk-docs branch from 6286e37 to 8b29a23 Compare July 30, 2026 02:19
@UnknownJoe796
UnknownJoe796 changed the base branch from v53/docs-files-websockets to version-5.3 July 30, 2026 02:24
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.

1 participant