Repository navigation
Document inline request bodies in Swagger, hide browser-only routes - #1558
Merged
Merged
Conversation
Routes that typed @Body() with an inline TypeScript type showed no request schema in the OpenAPI document, because Nest cannot reflect a type literal or an interface. Management API: add @ApiBody schemas, examples and amcp snippets to POST /api/adapters/starter-pack/install, the knowledge-graph node and edge routes (POST/PATCH nodes, POST/PATCH edges), POST /api/connectors/:id/oauth/authorize and PUT /api/mcp-connections/:id. Also document the returnTo body of the Shopee and TikTok Shop authorize routes and mark them as dashboard-session routes. Browser and dashboard-internal flows are now excluded with @ApiExcludeEndpoint: the MCP client sign-in form posts (login, file-search session, select-servers, first-app), the OAuth, Shopee and TikTok Shop completion routes, the TikTok Shop App Store install, the setup-link routes and product events. The Connector setup and Product events tags had no visible route left and are removed. Documentation only: handlers, validation and responses are unchanged.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What
Swagger showed an empty request body for several endpoints whose body is typed inline instead of with a DTO class. This adds
@ApiBodyschemas with examples for them, and hides routes that only the dashboard or a browser redirect calls.Documented with
@ApiBody:POST /api/adapters/starter-pack/installPOST /api/knowledge-graph/nodes,PATCH /api/knowledge-graph/nodes/:idPOST /api/knowledge-graph/edges,PATCH /api/knowledge-graph/edges/:idPOST /api/connectors/:id/oauth/authorizePUT /api/mcp-connections/:clientIdPOST connectors/:id/authorize(they also get@ApiBearerAuth(), which was missing)Hidden with
@ApiExcludeEndpoint: setup-linksresolve/open, TikTok Shopinstall,POST /api/product-events, the four login form posts,POST /api/mcp-oauth/complete, and the Shopee/TikTok Shopcompleteroutes. The "Connector setup" and "Product events" tags are removed, because every route under them is now hidden.@ApiBodyinstead of DTO classes on purpose: the globalValidationPipeusesforbidNonWhitelisted, so a DTO would start rejecting fields the handlers accept today. This PR changes documentation only, not behaviour.Deployment modes
Same in Cloud and self-hosted: only the OpenAPI document at
/api/docschanges.Checks (in
packages/backend)npx tsc --noEmit -p tsconfig.json: 0 errors (after installing the locally missing baseline modules: picomatch types, @aws-sdk/client-s3, @smithy/node-http-handler, basic-ftp, ssh2).npx eslinton the 12 changed files: clean.npx jest --maxWorkers=4on the 16 related specs, includingcommon/openapi.spec.ts: 390/390 passed.node scripts/generate-cli-operations.mjs --check: up to date (206 operations).node scripts/generate-llms-txt.mjs --check: exit 0.No
ee/file changed.