Skip to content

fix(openapi): handle ZodVoid responses as 204 No Content#112

Open
kentwilliam wants to merge 1 commit intomainfrom
kentwilliam/fix-void-openapi-response
Open

fix(openapi): handle ZodVoid responses as 204 No Content#112
kentwilliam wants to merge 1 commit intomainfrom
kentwilliam/fix-void-openapi-response

Conversation

@kentwilliam
Copy link
Copy Markdown

@kentwilliam kentwilliam commented Apr 17, 2026

This was causing 500s.

Context

This avoids crashes for these endpoints:

  • DELETE /api/account/device-connections/{connectionId}
  • DELETE /api/orgs/{orgName}/postman-credentials
  • DELETE /api/orgs/{orgName}/vcs-app
  • DELETE /api/orgs/{orgName}/projects/{projectName}
  • DELETE /api/orgs/{orgName}/pending-projects/{projectName}
  • DELETE /api/orgs/{orgName}/projects/{projectName}/sdk-requests
  • DELETE /api/orgs/{orgName}/projects/{projectName}/sdks/{language}
  • DELETE /api/docs-sites/{docsSiteId}/domains/{domainId}
  • DELETE /api/users/{userId}/tutorial-modals/{modalType}

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Stainless OpenAPI spec generator to correctly represent endpoints whose response schema defaults to z.void() by emitting a 204 No Content response instead of attempting to serialize a ZodVoid schema (which crashes GET /api/openapi).

Changes:

  • Detect ZodVoid response schemas during OpenAPI generation.
  • Emit 204 No Content responses (no body) for ZodVoid endpoints; otherwise keep existing 200 application/json behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kentwilliam kentwilliam marked this pull request as ready for review April 17, 2026 10:56
@dgellow
Copy link
Copy Markdown
Member

dgellow commented Apr 17, 2026

Seems to relate to #110 🤔
I would need to check what was the context for that change, I remember doing it when handling an incident

Edit: sorry, I meant this one #108. Though that also relates to #110, incidentally.
There is more context in that PR

Copy link
Copy Markdown
Member

@dgellow dgellow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

4 participants