Skip to content

DTO @ApiProperty + MCP arguments alias (#5 + #4)#162

Merged
keysersoft merged 1 commit into
mainfrom
keysersoft/dto-api-property
May 11, 2026
Merged

DTO @ApiProperty + MCP arguments alias (#5 + #4)#162
keysersoft merged 1 commit into
mainfrom
keysersoft/dto-api-property

Conversation

@keysersoft
Copy link
Copy Markdown
Contributor

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:

  • `auth.controller.ts` (LoginDto, RegisterDto, VerifyEmailDto, ForgotPasswordDto, ResetPasswordDto, InviteUserDto, AcceptInviteDto)
  • `connectors.controller.ts` (CreateConnectorDto, UpdateConnectorDto, ImportToolsDto, ImportToolDto, ImportConnectorDto, ImportAllDto, UpdateEnvVarsDto)
  • `tools.controller.ts` (CreateToolDto, UpdateToolDto, BulkCreateToolsDto, TestToolDto)
  • `mcp-servers.controller.ts` (CreateMcpServerDto, UpdateMcpServerDto, AssignConnectorsDto)
  • `site-settings.controller.ts` (SmtpConfigDto, FooterLinkDto, FooterLinksDto)
  • `roles.controller.ts` (CreateRoleDto, UpdateRoleDto, SetToolAccessDto, AssignRoleDto)
  • `mcp-api-keys.controller.ts` (CreateKeyDto)
  • `users.controller.ts` (UpdateProfileDto, ChangePasswordDto, UpdateUserRoleDto, DeleteSelfDto)
  • `organizations.controller.ts` (UpdateOrganizationDto, SwitchOrgDto, CreateOrgDto, DeleteOrgDto)

#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

  • `tsc --noEmit` exit 0
  • `npm test` → 601 passed, no behavioural regression
  • After deploy: `curl /api/docs-json | jq '.components.schemas.CreateConnectorDto.properties'` should show descriptions/examples instead of `{}`.
  • After deploy: POST /api/connectors/:id/tools/:toolId/test with `{arguments: {...}}` should work identically to `{params: {...}}`.

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).
@keysersoft keysersoft merged commit b96416a into main May 11, 2026
11 checks passed
@keysersoft keysersoft deleted the keysersoft/dto-api-property branch May 11, 2026 15:18
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.

1 participant