Skip to content

fix(openapi): make the served spec pass strict validation - #271

Merged
vigneshrajsb merged 1 commit into
mainfrom
fix/openapi-spec-validation
Oct 26, 2026
Merged

vigneshrajsb merged 1 commit into
mainfrom
fix/openapi-spec-validation

Conversation

@vigneshrajsb

Copy link
Copy Markdown
Contributor

Summary

The spec served at /api/docs failed strict OpenAPI validation (orval 8, 16 errors), forcing generator consumers to disable validation. It now validates cleanly.

Description

  • Quote flow-style response descriptions containing commas/colons (POST /environments 403/422, PATCH /environments/{uuid} 422, POST /tokens and POST /me/tokens 403); they were parsed as stray keys.
  • GET /builds/{uuid}/services/{name}/deploys: fix indentation so 400/404/500/502 sit under responses.
  • GET /ai/agent/mcp-connections/{slug}/oauth/callback: add the missing responses (HTML 200/400/404/409/410/422 matching the handler).
  • SuccessApiResponse.error and ApiErrorResponse.data: type: 'null' becomes nullable: true (OpenAPI 3.0).
  • AgentSessionStringRecord: drop unsupported propertyNames.
  • AgentAdminThreadSummary.latestRun: $ref with sibling nullable becomes nullable + allOf.

Generated type impact

Generated clients may see small changes: the two null-typed fields lose their explicit null type (now untyped nullable), and AgentSessionStringRecord no longer carries the key minLength constraint (still enforced at runtime). No runtime behavior or response shapes change.

Verifying Changes

  • Generated the spec and ran orval@8.44.0 without unsafeDisableValidation: no errors or warnings.
  • New test in openApiSpec.test.ts validates the spec with @scalar/openapi-parser (added as a dev dependency); it reports 16 errors on the old spec.
  • pnpm lint and pnpm test pass.

Quote flow-style response descriptions containing commas and colons, fix
mis-indented deploy-jobs responses, add responses to the MCP OAuth callback,
replace unsupported null types and propertyNames, and add a validity test.
@vigneshrajsb
vigneshrajsb marked this pull request as ready for review October 23, 2026 21:38
@vigneshrajsb
vigneshrajsb requested a review from a team as a code owner October 23, 2026 21:38
@vigneshrajsb
vigneshrajsb merged commit 39fd988 into main Oct 26, 2026
1 check passed
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.

2 participants