Skip to content

Conversation

@LorianeE
Copy link
Collaborator

@LorianeE LorianeE commented Oct 28, 2025

Information

Type Breaking change
Doc No

Add info for users about QueryParams decorator: for an array, the type must be specified (even if primitive).

Todos

  • Tests
  • Documentation

Summary by CodeRabbit

  • Documentation

    • Enhanced QueryParams documentation with comprehensive array support examples, clarifying required type declarations for array elements.
  • Tests

    • Added new test scenarios validating array query parameter handling, including verification of proper error conditions and request validation.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 28, 2025

Walkthrough

The changes add documentation and examples demonstrating array support in the QueryParams decorator, and introduce a new test endpoint (/scenario-7) with an accompanying test case to validate array query parameter handling behavior.

Changes

Cohort / File(s) Summary
Documentation Updates
packages/platform/platform-params/src/decorators/queryParams.ts
Added documentation notes and extended examples explaining that QueryParams supports arrays by specifying the array element type (e.g., @QueryParams('ids', String) for string[]).
New Test Scenario
packages/platform/platform-test-sdk/src/tests/testQueryParams.ts
Added new GET endpoint at /scenario-7 in TestQueryParamsCtrl to accept array query parameters via @QueryParams("test") with string[] type. Introduced corresponding test case (Scenario7) that verifies the endpoint returns a 400 Bad Request response when invoked with multiple test values, indicating validation of array query param metadata handling.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Review the documentation additions in the QueryParams decorator for accuracy and clarity of array usage examples
  • Verify the new test endpoint correctly accepts array query parameters and that the test assertion properly validates the expected 400 Bad Request behavior

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "docs(queryParams): add info about metadata for arrays" accurately reflects the primary objective of the changeset. The raw summary shows that the main change is a documentation-only update to queryParams.ts that explains QueryParams array support requirements, which is precisely what the title communicates. While the PR also includes a test scenario (Scenario7) to validate array query parameter behavior, these are supporting additions that validate the documented behavior rather than the primary focus. The title is concise, uses clear terminology ("docs", "queryParams", "metadata", "arrays"), and would allow a teammate reviewing the history to quickly understand that this PR documents how to use QueryParams with array types.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs-queryparams

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ca2ed20 and 0b80702.

📒 Files selected for processing (2)
  • packages/platform/platform-params/src/decorators/queryParams.ts (2 hunks)
  • packages/platform/platform-test-sdk/src/tests/testQueryParams.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
packages/platform/platform-test-sdk/src/tests/testQueryParams.ts (1)
packages/platform/platform-params/src/decorators/queryParams.ts (1)
  • QueryParams (56-66)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: test-platform (20.19.4)
  • GitHub Check: lint (20.19.4)
  • GitHub Check: test-specs (20.19.4)
  • GitHub Check: test-security (20.19.4)
  • GitHub Check: test-core (20.19.4)
  • GitHub Check: test-third-parties (20.19.4)
  • GitHub Check: test-graphql (20.19.4)
  • GitHub Check: CodeQL-Build
  • GitHub Check: test-orm (20.19.4)
🔇 Additional comments (3)
packages/platform/platform-params/src/decorators/queryParams.ts (2)

9-10: LGTM! Clear documentation of array handling requirement.

The note effectively highlights that array query parameters require explicit element type specification. This aligns with the test validation added in the companion file.


28-32: LGTM! Example demonstrates the requirement clearly.

The example effectively shows the correct syntax for primitive array types, which is exactly what the documentation note describes.

packages/platform/platform-test-sdk/src/tests/testQueryParams.ts (1)

51-54: LGTM! Negative test case for missing array element type.

This endpoint correctly demonstrates the invalid usage pattern (missing String type specification) to validate that the framework properly rejects it, as documented in the QueryParams decorator.

@Romakita Romakita merged commit 37644dc into production Oct 28, 2025
12 checks passed
@Romakita Romakita deleted the docs-queryparams branch October 28, 2025 12:49
@Romakita
Copy link
Collaborator

Romakita commented Nov 4, 2025

🎉 This PR is included in version 8.18.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants