chore: 🐝 Update SDK - Generate 0.2.6 - #3538
Conversation
|
|
5af230f to
7680c13
Compare
There was a problem hiding this comment.
3 issues found across 15 files
Confidence score: 4/5
- In
apps/mcp-server/src/models/answersinglequestiondto.ts,organizationIdis required inAnswerSingleQuestionDtobut then overwritten by@OrganizationId(), so clients must send a value that is ignored, creating contract confusion and avoidable integration errors — make the DTO field optional/removed (or align controller behavior) so ownership comes from auth only. - In
apps/mcp-server/src/models/answersinglequestiondto.ts, SDK-side validation fortotalis looser than the API (allows zero/negative/fractional), which shifts failures from local validation to runtime API rejections and degrades caller UX — generate the API integer + minimum-one constraint into the SDK model. - In
apps/mcp-server/src/models/answersinglequestiondto.ts, SDK-side validation for question index allows negative/fractional values that the API rejects, increasing avoidable request failures and retry noise — generate the API integer + non-negative constraint so invalid inputs fail early withSDKValidationError.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/mcp-server/src/models/answersinglequestiondto.ts">
<violation number="1" location="apps/mcp-server/src/models/answersinglequestiondto.ts:18">
P2: The `organizationId` field is required in `AnswerSingleQuestionDto`, but the API controller immediately overwrites it with the authenticated organization ID from `@OrganizationId()` — meaning the client-provided value is completely discarded. This creates a misleading SDK contract where callers must include a field that has no effect. The description says it is "for validation" but the server code performs no validation; it simply replaces the value. This contradicts the established pattern (reflected in prior feedback) that the organization ID should be derived from the auth context rather than accepted in the request body. Consider removing `organizationId` from the DTO and deriving it server-side via `@OrganizationId()` as is done for other endpoints.</violation>
<violation number="2" location="apps/mcp-server/src/models/answersinglequestiondto.ts:22">
P2: SDK validation accepts negative or fractional question indexes, then the API rejects them. Generate the API's integer/non-negative constraint here so callers get an `SDKValidationError` before the request.</violation>
<violation number="3" location="apps/mcp-server/src/models/answersinglequestiondto.ts:28">
P2: SDK validation accepts zero, negative, or fractional totals, then the API rejects them. Generate the API's integer/minimum-one constraint so invalid tool input fails locally.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
| questionnaireId: z.string().optional().describe( | ||
| "Optional questionnaire record to save the generated answer into. Omit for webpage-only answer generation.", | ||
| ), | ||
| totalQuestions: z.number().describe( |
There was a problem hiding this comment.
P2: SDK validation accepts zero, negative, or fractional totals, then the API rejects them. Generate the API's integer/minimum-one constraint so invalid tool input fails locally.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/mcp-server/src/models/answersinglequestiondto.ts, line 28:
<comment>SDK validation accepts zero, negative, or fractional totals, then the API rejects them. Generate the API's integer/minimum-one constraint so invalid tool input fails locally.</comment>
<file context>
@@ -4,8 +4,28 @@
+ questionnaireId: z.string().optional().describe(
+ "Optional questionnaire record to save the generated answer into. Omit for webpage-only answer generation.",
+ ),
+ totalQuestions: z.number().describe(
+ "Total number of questions in the current questionnaire or page batch.",
+ ),
</file context>
| totalQuestions: z.number().describe( | |
| totalQuestions: z.number().int().min(1).describe( |
| "Organization ID for validation. The API uses the authenticated active organization and overwrites this value server-side.", | ||
| ), | ||
| question: z.string().describe("Security questionnaire question to answer."), | ||
| questionIndex: z.number().describe( |
There was a problem hiding this comment.
P2: SDK validation accepts negative or fractional question indexes, then the API rejects them. Generate the API's integer/non-negative constraint here so callers get an SDKValidationError before the request.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/mcp-server/src/models/answersinglequestiondto.ts, line 22:
<comment>SDK validation accepts negative or fractional question indexes, then the API rejects them. Generate the API's integer/non-negative constraint here so callers get an `SDKValidationError` before the request.</comment>
<file context>
@@ -4,8 +4,28 @@
+ "Organization ID for validation. The API uses the authenticated active organization and overwrites this value server-side.",
+ ),
+ question: z.string().describe("Security questionnaire question to answer."),
+ questionIndex: z.number().describe(
+ "Zero-based index of this question in the questionnaire or page batch.",
+ ),
</file context>
| questionIndex: z.number().describe( | |
| questionIndex: z.number().int().min(0).describe( |
| AnswerSingleQuestionDto | ||
| > = z.object({}); | ||
| > = z.object({ | ||
| organizationId: z.string().describe( |
There was a problem hiding this comment.
P2: The organizationId field is required in AnswerSingleQuestionDto, but the API controller immediately overwrites it with the authenticated organization ID from @OrganizationId() — meaning the client-provided value is completely discarded. This creates a misleading SDK contract where callers must include a field that has no effect. The description says it is "for validation" but the server code performs no validation; it simply replaces the value. This contradicts the established pattern (reflected in prior feedback) that the organization ID should be derived from the auth context rather than accepted in the request body. Consider removing organizationId from the DTO and deriving it server-side via @OrganizationId() as is done for other endpoints.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/mcp-server/src/models/answersinglequestiondto.ts, line 18:
<comment>The `organizationId` field is required in `AnswerSingleQuestionDto`, but the API controller immediately overwrites it with the authenticated organization ID from `@OrganizationId()` — meaning the client-provided value is completely discarded. This creates a misleading SDK contract where callers must include a field that has no effect. The description says it is "for validation" but the server code performs no validation; it simply replaces the value. This contradicts the established pattern (reflected in prior feedback) that the organization ID should be derived from the auth context rather than accepted in the request body. Consider removing `organizationId` from the DTO and deriving it server-side via `@OrganizationId()` as is done for other endpoints.</comment>
<file context>
@@ -4,8 +4,28 @@
AnswerSingleQuestionDto
-> = z.object({});
+> = z.object({
+ organizationId: z.string().describe(
+ "Organization ID for validation. The API uses the authenticated active organization and overwrites this value server-side.",
+ ),
</file context>
* `CompAi.Questionnaire.QuestionnaireController_answerSingleQuestion_v1()`: `request` **Changed** (Breaking⚠️ )
d8f0f1b to
7acf1ce
Compare
SDK update
Versioning
Version Bump Type: [patch] - 🤖 (automated)
Tip
If updates to your OpenAPI document introduce breaking changes, be sure to update the
info.versionfield to trigger the correct version bump.Speakeasy supports manual control of SDK versioning through multiple methods.
Mcp-typescript SDK Changes:
CompAi.Questionnaire.QuestionnaireController_answerSingleQuestion_v1():requestChanged (BreakingView full SDK changelog
OpenAPI Change Summary
View full report
Linting Report
0 errors, 241 warnings, 316 hintsView full report
MCP-TYPESCRIPT CHANGELOG
No relevant generator changes
Based on Speakeasy CLI 1.791.0
Last updated by Speakeasy workflow