DTO @ApiProperty + MCP arguments alias (#5 + #4)#162
Merged
Conversation
Two fixes bundled: (#5) Add @ApiProperty / @ApiPropertyOptional to every DTO under auth, connectors, tools, mcp-servers, site-settings, roles, mcp-api-keys, users, organizations. Before this, /api/docs-json returned an empty properties:{} for these DTOs because nestjs-swagger needs explicit metadata when no @nestjs/swagger CLI plugin is configured. Anyone trying to automate against the API had to clone the repo and read the controllers. (#4) The tool test endpoint POST /api/connectors/:id/tools/:toolId/test historically accepted { params: {...} }, but the MCP standard (and what every spec-compliant client sends) is { arguments: {...} }. The DTO now exposes both fields; the handler prefers 'arguments' and falls back to 'params' for legacy callers. The deprecation is expressed in the @ApiProperty so OpenAPI consumers see it. Tests: 601 passing (no behavioural change for existing callers).
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.
Summary
Two related fixes bundled (both are mechanical, low-risk).
#5 — DTO @ApiProperty decorators
`/api/docs-json` returned `properties: {}` for every DTO because `nestjs-swagger` needs explicit metadata when no CLI plugin is configured. Anyone automating against the API had to clone the repo and read the controllers. Decorated all DTOs in:
#4 — MCP `arguments` alias on tool test
`POST /api/connectors/:id/tools/:toolId/test` historically accepted `{ params: {...} }`. MCP-standard is `{ arguments: {...} }`. The DTO now exposes both; the handler prefers `arguments` and falls back to `params` for legacy callers. `params` is marked `deprecated: true` in the `@ApiProperty` so OpenAPI consumers can see it's a legacy alias.
Test plan