Repository navigation
fix(api): make the OpenAPI document generate again - #37
Merged
Merged
Conversation
/swagger rendered an empty spec ("does not specify a valid version
field") because settings.getOpenApiDocument returned 500: the generator
throws for the whole router as soon as one procedure has an input it
cannot describe.
- dockerDiskUsage.getDiskUsage and settings.getDockerDiskUsage took
detailLimit as a union of numeric literals, which the generator rejects
for query inputs. Both now share dockerDiskUsageDetailLimitSchema, a
coerced number piped into 5 | 10 | 15, so the generator accepts it and
REST callers can pass ?detailLimit=5.
- github.appSetupState takes a discriminated-union input the generator
cannot express. It only drives the in-panel GitHub App setup redirect,
so it is excluded from OpenAPI like readStatsLogs.
- A test generates the document for the full app router so a new
procedure cannot silently break /swagger again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er-openapi-version-8646fe # Conflicts: # apps/dokploy/__test__/settings/docker-server-boundary.test.ts # apps/dokploy/__test__/settings/request-log-authorization.test.ts
"Time left" is floored to whole minutes. When a millisecond passed between building expiresAt and formatting the alert, the message read "23 h 59 min" and the test failed in CI. Freezing only Date keeps fetch and the rest of the timers real. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
/swaggershows "The provided definition does not specify a valid version field". The page itself loads, butsettings.getOpenApiDocumentreturns 500, so Swagger UI renders its empty initial spec{}.generateOpenApiDocumentthrows for the whole router as soon as one procedure has an input it can't describe:Both procedures were added in this fork, not upstream.
Fix
dockerDiskUsage.getDiskUsageandsettings.getDockerDiskUsagenow sharedockerDiskUsageDetailLimitSchema. It is a coerced number piped into5 | 10 | 15, still nullable/optional. The generator accepts it, the tRPC client keeps sending numbers, and REST callers can now pass?detailLimit=5. Before this change, that string failed the literal check.github.appSetupStatetakes a discriminated-union input the generator can't express. It only drives the in-panel GitHub App setup redirect, so it is excluded from OpenAPI withenabled: false, the same wayreadStatsLogsis.__test__/api/openapi-document.test.tsgenerates the document for the full app router and checks the detail-limit parsing. Two tests that mock@dokploy/servernow also mock the new schema.Verification
tsc --noEmitand biome pass.deploy/application.real.test.ts(4 tests). Those tests run real Docker/nixpacks builds and are unrelated to this change.After deploy,
/swaggershould list the API. Use Authorize with an API key to send requests.🤖 Generated with Claude Code