Skip to content

Conversation

@nameless-mc
Copy link
Contributor

Why

Only the PluginClient.getPlugins() method performs runtime validation for the ids parameter, while other API methods (such as AppClient.getApps(), PluginClient.getRequiredPlugins()) do not implement similar validation. To maintain consistency across the API, we should remove the validation from getPlugins() and rely on TypeScript's type system like other methods.

What

  • Removed runtime validation for the ids parameter from PluginClient.getPlugins() method
    • Removed validation: array type check, array element type check
  • Removed corresponding test cases (5 tests)
    • Tests that expected validation errors
  • Maintained normal case tests (with ids parameter)

With this change, the getPlugins() method will rely solely on TypeScript's type checking, consistent with other methods.

How to test

Checklist

  • Read CONTRIBUTING.md
  • Updated documentation if it is required.
  • Added tests if it is required.
  • Passed pnpm lint and pnpm test on the root directory.

@nameless-mc nameless-mc self-assigned this Nov 19, 2025
Copilot AI review requested due to automatic review settings November 19, 2025 06:34
@nameless-mc nameless-mc requested a review from a team as a code owner November 19, 2025 06:34
@nameless-mc nameless-mc requested review from chihiro-adachi and shabaraba and removed request for a team November 19, 2025 06:34
@github-actions github-actions bot added the pkg: rest-api-client @kintone/rest-api-client label Nov 19, 2025
Copy link
Member

@tasshi-me tasshi-me left a comment

Choose a reason for hiding this comment

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

LGTM!

Copilot finished reviewing on behalf of nameless-mc November 19, 2025 06:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes runtime parameter validation from the PluginClient.getPlugins() method to achieve consistency with other similar API methods in the codebase. The change shifts validation responsibility entirely to TypeScript's type system.

Key Changes:

  • Removed runtime validation logic for the ids parameter in getPlugins()
  • Removed 5 corresponding test cases that validated the runtime checks
  • Maintained existing tests for normal operation with the ids parameter

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/rest-api-client/src/client/PluginClient.ts Removed runtime validation for ids parameter (array type check and string element check) from getPlugins() method
packages/rest-api-client/src/client/__tests__/PluginClient.test.ts Removed 5 test cases that validated the runtime parameter checking behavior

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: rest-api-client @kintone/rest-api-client

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants