Skip to content

feat: add support for update report definition endpoint#157

Open
smcgowan-smartsheet wants to merge 10 commits intosmartsheet:mainlinefrom
smcgowan-smartsheet:feat/update-report-definition
Open

feat: add support for update report definition endpoint#157
smcgowan-smartsheet wants to merge 10 commits intosmartsheet:mainlinefrom
smcgowan-smartsheet:feat/update-report-definition

Conversation

@smcgowan-smartsheet
Copy link
Copy Markdown

Add support for PATCH /reports/{reportId}/definition endpoint

@roomote-v0
Copy link
Copy Markdown

roomote-v0 bot commented Feb 24, 2026

Rooviewer Clock   See task

Latest commit removed UpdateReportDefinitionResponse type. Two previous issues resolved, but found critical HTTP method mismatch between implementation and documentation.

  • Fix URL format in CHANGELOG (missing forward slash before {reportId})
  • Update test name to follow standard naming convention
  • Use unique x-test-name for query parameter test to align with its own WireMock mapping
  • Fix HTTP method mismatch: Implementation uses PUT but API documentation specifies PATCH
  • Update test name to match actual HTTP method being tested
Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@smcgowan-smartsheet smcgowan-smartsheet marked this pull request as ready for review February 24, 2026 11:55
@roomote-v0
Copy link
Copy Markdown

roomote-v0 bot commented Feb 24, 2026

Rooviewer Clock   See task

Review complete. Found 2 minor issues related to formatting and naming conventions.

  • Fix URL format in CHANGELOG (missing forward slash before {reportId})
  • Update test name to follow standard naming convention

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

updateFilters: true,
customProperties: {
'x-request-id': requestId,
'x-test-name': '/reports/update-report-definition/all-response-body-properties'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The x-test-name value should be unique for this test since it's specifically testing query parameter handling. Using the same test name as other tests (/reports/update-report-definition/all-response-body-properties) will cause this test to use the same WireMock mapping as the all-properties test, which may not have the expected query parameters configured. Consider using a more specific name like /reports/update-report-definition/with-update-filters-query-param.

Fix it with Roo Code or mention @roomote and request a fix.

change aggregationCriteria to summarizingCriteria to match spec

add returns report definition
Comment on lines +220 to +223
updateReportDefinition: (
options: UpdateReportDefinitionOptions,
callback?: RequestCallback<BaseResponseStatus>
) => Promise<BaseResponseStatus>;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return type BaseResponseStatus doesn't match the actual API response structure. The test expects a result property containing the updated ReportDefinition, but BaseResponseStatus only has message and resultCode. This creates a type contract violation where the actual response includes properties not reflected in the type definition. Consider creating a specific response type like UpdateReportDefinitionResponse extends BaseResponseStatus with a result?: ReportDefinition property, similar to how SetReportPublishStatusResponse is structured.

Fix it with Roo Code or mention @roomote and request a fix.

changed to PUT from PATCH

no longer returning changed definition

no longer needs query param
expect(parsedUrl.pathname).toEqual(`/2.0/reports/${TEST_REPORT_ID}/definition`);
});

it('updateReportDefinition uses PATCH method', async () => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test name claims to verify PATCH method usage, but the test expects PUT and the implementation uses requestor.put(). This creates confusion about which HTTP method is actually being used. Either update the test name to reflect PUT, or change the implementation to use PATCH if that's what the API requires.

Fix it with Roo Code or mention @roomote and request a fix.

updateFilters: patchOptions.updateFilters,
},
};
return requestor.put({ ...optionsToSend, ...urlOptions, ...patchOptions }, callback);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation uses requestor.put() which sends a PUT request, but the API documentation in the JSDoc (line 193 of types.ts) explicitly states this mirrors PATCH /reports/{reportId}/definition. This HTTP method mismatch means the SDK is calling the wrong endpoint method. The implementation should use requestor.patch() to match the documented API contract.

Suggested change
return requestor.put({ ...optionsToSend, ...urlOptions, ...patchOptions }, callback);
return requestor.patch({ ...optionsToSend, ...urlOptions, ...patchOptions }, callback);

Fix it with Roo Code or mention @roomote and request a fix.

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