Skip to content

fix: support multiple WebSocket channels with query parameters #1973#2106

Open
SushanthMusham wants to merge 5 commits into
asyncapi:masterfrom
SushanthMusham:fix/getQueryParams
Open

fix: support multiple WebSocket channels with query parameters #1973#2106
SushanthMusham wants to merge 5 commits into
asyncapi:masterfrom
SushanthMusham:fix/getQueryParams

Conversation

@SushanthMusham
Copy link
Copy Markdown
Contributor

@SushanthMusham SushanthMusham commented May 26, 2026

Problem:

The getQueryParams() helper function in packages/helpers/src/bindings.js currently assumes that only one channel has WebSocket bindings. This limitation prevents AsyncAPI documents with multiple channels from properly exposing query parameters for all channels.

Example scenario from issue #1973:

channels:
  chat:
    address: /chat/{roomId}
    bindings:
      ws:
        query:
          properties:
            token: { type: string }

  notifications:
    address: /notifications
    bindings:
      ws:
        query:
          properties:
            userId: { type: string }
            token: { type: string }

  alerts:
    address: /alerts/{severity}
    bindings:
      ws:
        query:
          properties:
            token: { type: string }

With the current implementation, only the first channel's query parameters are returned, completely ignoring notifications and alerts channels.

Solution Overview

The refactoring introduces a new helper function and restructures the existing one to support multiple channels while maintaining 100% backward compatibility.

Code Changes

1. New Function: getQueryParamsForAllChannels(channels)

  • Purpose: Extracts query parameters from ALL channels with WebSocket bindings

  • Return Type: Map<string, Map<string,string>> - Nested map structure

    • Outer map keys: Channel names
    • Inner map keys: Parameter names
    • Inner map values: Parameter defaults (or empty string '')
  • Behavior:

    • Returns empty Map if no channels have WS bindings
    • Skips channels without WS bindings
    • Skips channels where WS binding lacks query parameters
    • Iterates through ALL channels and builds complete parameter map
  • Example:

const allParams = getQueryParamsForAllChannels(channels);

// Result:
// Map {
//   'chat' => Map { 'token' => 'auth123', 'roomId' => '' },
//   'notifications' => Map { 'userId' => 'user456', 'token' => '' },
//   'alerts' => Map { 'token' => 'default_token' }
// }

const chatParams = allParams.get('chat');

console.log(chatParams.get('token')); // → 'auth123'

2. Refactored Function: getQueryParams(channels)

  • Purpose: Maintains backward compatibility by returning only the FIRST channel's parameters

  • Implementation: Now internally uses getQueryParamsForAllChannels() and returns the first entry

  • Behavior: Identical to original implementation - returns first channel's params or null

  • Breaking Changes: NONE - completely backward compatible

  • Example:

const params = getQueryParams(channels);

// Returns only first channel:
// Map { 'token' => 'auth123', 'roomId' => '' }

console.log(params.get('token')); // → 'auth123'
console.log(params.get('roomId')); // → ''

3. Updated Exports: packages/helpers/src/index.js

  • Added getQueryParamsForAllChannels to the module exports
  • Allows consumers to access the new function from @asyncapi/generator-helpers
const { getQueryParams, getQueryParamsForAllChannels } = require('./bindings');

module.exports = {
  // ... other exports
  getQueryParams,
  getQueryParamsForAllChannels,  // ← NEW EXPORT
  // ... other exports
};

Key Design Decisions

  • DRY Principle: getQueryParams() now uses getQueryParamsForAllChannels() internally, eliminating code duplication
  • Backward Compatibility: getQueryParams() maintains identical behavior and return type
  • Logical Grouping: Both functions remain in bindings.js since they're cohesive binding-related helpers
  • Return Type Consistency: Returns null when no channels have WS bindings (consistent with original behavior)

Benefits

  • Multiple Channel Support - Access query parameters from all WebSocket channels
  • Zero Breaking Changes - Existing code continues to work without modification
  • Code Reuse - Eliminates duplicate logic between old and new implementation
  • Future-Proof - Clients can gradually migrate to getQueryParamsForAllChannels() if needed
  • Well-Documented - Comprehensive JSDoc with examples for both functions

Test Results

All existing tests pass with 100% coverage for bindings.js:

> @asyncapi/generator-helpers@1.1.0 test
> jest --coverage bindings.test.js

 PASS  test/bindings.test.js
  getQueryParams integration test with AsyncAPI
    ✓ should extract query parameters from WebSocket binding with properties (1 ms)
    ✓ should return null for channel without WebSocket binding
    ✓ should return null for empty channels map
    ✓ should return null for channel with empty binding (2 ms)
    ✓ should return null if WebSocket binding exists but has no query parameters
    ✓ should return null if WebSocket binding query exists but has no properties

-------------------|---------|----------|---------|---------|-------------------------------------
File               | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-------------------|---------|----------|---------|---------|-------------------------------------
All files          |   31.12 |    14.73 |    7.89 |   31.44 |
ModelsPresets.js   |   41.17 |        0 |      20 |   41.17 | 5,12-23,32
bindings.js        |     100 |      100 |     100 |     100 |
discriminators.js  |      10 |        0 |       0 |      10 | 9-33,47-66
index.js           |     100 |      100 |     100 |     100 |
operations.js      |    7.69 |        0 |       0 |    7.69 | 11-36
servers.js         |   18.51 |        0 |       0 |   18.51 | 9-21,35-44,55-61,72-78
testing.js         |      10 |        0 |       0 |   10.52 | 9-105,119-124
utils.js           |   22.22 |        0 |       0 |   22.22 | 10-20,33-42,54-60,71-74,79-81,85,89
-------------------|---------|----------|---------|---------|-------------------------------------

Test Suites: 1 passed, 1 total
Tests:       6 passed, 6 total
Snapshots:   0 total
Time:        1.536 s, estimated 2 s
Ran all test suites matching /bindings.test.js/i.

Files Modified

  1. packages/helpers/src/bindings.js - Added new function, refactored existing function
  2. packages/helpers/src/index.js - Added new export

Migration Guide (Optional for consumers)

Before (still works)

const queryParams = getQueryParams(asyncapi.channels());

// Only gets first channel's params

After (new capability)

const allChannelsParams = getQueryParamsForAllChannels(asyncapi.channels());

// Access specific channel
const chatParams = allChannelsParams.get('chat');

// Or iterate through all channels
for (const [channelName, params] of allChannelsParams.entries()) {
  console.log(`Channel: ${channelName}`);

  for (const [paramName, paramValue] of params.entries()) {
    console.log(`  ${paramName}: ${paramValue}`);
  }
}

Related issue(s)

Summary by CodeRabbit

  • New Features

    • Extract query parameters for all WebSocket channels, returning per-channel parameter maps.
    • Preserve backward compatibility: single-channel query lookup still returns the first channel’s parameters (or null).
  • Tests

    • Added integration tests covering multiple WebSocket channels, skipping non-WebSocket channels, empty inputs, channels with empty bindings, and no-WebSocket scenarios.

Review Change Stack

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 26, 2026

⚠️ No Changeset found

Latest commit: 94e943e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@asyncapi-bot
Copy link
Copy Markdown
Contributor

What reviewer looks at during PR review

The following are ideal points maintainers look for during review. Reviewing these points yourself beforehand can help streamline the review process and reduce time to merge.

  1. PR Title: Use a concise title that follows our Conventional Commits guidelines and clearly summarizes the change using imperative mood (it means spoken or written as if giving a command or instruction, like "add new helper for listing operations")

    Note - In Generator, prepend feat: or fix: in PR title only when PATCH/MINOR release must be triggered.

  2. PR Description: Clearly explain the issue being solved, summarize the changes made, and mention the related issue.

    Note - In Generator, we use Maintainers Work board to track progress. Ensure the PR Description includes Resolves #<issue-number> or Fixes #<issue-number> this will automatically close the linked issue when the PR is merged and helps automate the maintainers workflow.

  3. Documentation: Update the relevant Generator documentation to accurately reflect the changes introduced in the PR, ensuring users and contributors have up-to-date guidance.

  4. Comments and JSDoc: Write clear and consistent JSDoc comments for functions, including parameter types, return values, and error conditions, so others can easily understand and use the code.

  5. DRY Code: Ensure the code follows the Don't Repeat Yourself principle. Look out for duplicate logic that can be reused.

  6. Test Coverage: Ensure the new code is well-tested with meaningful test cases that pass consistently and cover all relevant edge cases.

  7. Commit History: Contributors should avoid force-pushing as much as possible. It makes it harder to track incremental changes and review the latest updates.

  8. Template Design Principles Alignment: While reviewing template-related changes in the packages/ directory, ensure they align with the Assumptions and Principles. If any principle feels outdated or no longer applicable, start a discussion these principles are meant to evolve with the project.

  9. Reduce Scope When Needed: If an issue or PR feels too large or complex, consider splitting it and creating follow-up issues. Smaller, focused PRs are easier to review and merge.

  10. Bot Comments: As reviewers, check that contributors have appropriately addressed comments or suggestions made by automated bots. If there are bot comments the reviewer disagrees with, react to them or mark them as resolved, so the review history remains clear and accurate.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b89ca25a-b94c-44ce-af45-6534e12ca359

📥 Commits

Reviewing files that changed from the base of the PR and between 0f154c6 and 94e943e.

📒 Files selected for processing (1)
  • packages/helpers/test/bindings.test.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/helpers/test/bindings.test.js

📝 Walkthrough

Walkthrough

Refactored WebSocket query parameter extraction to handle multiple AsyncAPI channels. Added getQueryParamsForAllChannels that returns query parameters for all channels, refactored the existing getQueryParams to call the new helper for backward compatibility, and exposed both functions through module exports.

Changes

Multi-channel WebSocket Query Parameters

Layer / File(s) Summary
Multi-channel query parameter extraction
packages/helpers/src/bindings.js
getQueryParamsForAllChannels aggregates WebSocket query parameter defaults across all channels into a nested Map, skipping channels without ws bindings or valid query.properties. The existing getQueryParams now delegates to this helper to return only the first channel's parameter map, preserving backward compatibility. Both are exported.
Public API exposure
packages/helpers/src/index.js
getQueryParamsForAllChannels is imported from ./bindings and added to module exports alongside getQueryParams to expose the new function to package consumers.
Tests updated for multi-channel support
packages/helpers/test/bindings.test.js
Tests import getQueryParamsForAllChannels and add integration cases asserting per-channel Maps, skipping of non-WS channels, empty-input behavior, empty binding handling, and multiple WS-bound channel extraction.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Title clearly summarizes the main change using imperative mood and includes Conventional Commits prefix 'fix:' indicating a bug fix or refactoring.
Linked Issues check ✅ Passed PR implements all coding requirements from #1973: adds getQueryParamsForAllChannels() for per-channel extraction, preserves backward compatibility in getQueryParams(), handles multiple ws-bound channels with query properties.
Out of Scope Changes check ✅ Passed All changes directly address #1973 requirements: new function for multi-channel support, refactored getQueryParams for backward compatibility, updated exports, and comprehensive tests.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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.

@SushanthMusham SushanthMusham changed the title Refactor: Support multiple WebSocket channels with query parameters #1973 Fix: Support multiple WebSocket channels with query parameters #1973 May 26, 2026
@SushanthMusham SushanthMusham changed the title Fix: Support multiple WebSocket channels with query parameters #1973 fix: Support multiple WebSocket channels with query parameters #1973 May 26, 2026
@SushanthMusham SushanthMusham changed the title fix: Support multiple WebSocket channels with query parameters #1973 fix: support multiple WebSocket channels with query parameters #1973 May 26, 2026
Copy link
Copy Markdown

@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: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/helpers/src/bindings.js`:
- Around line 60-71: The code currently treats an empty query.properties ({}) as
present and creates an empty channelParams Map which breaks the "no query params
=> null" contract; modify the loop that processes query.properties in
bindings.js (the block that reads const properties = query.properties and sets
channelParams then allChannelsParams.set(channelName, channelParams)) to skip
when properties is an empty object by checking e.g. if (!properties || typeof
properties !== 'object' || Object.keys(properties).length === 0) continue, and
apply the same empty-object check to the corresponding block at the other
occurrence (lines around the second block that sets channelParams at 118-123) so
channels with {} produce no entry (preserving null-on-empty behavior).
- Around line 4-6: Update the JSDoc for the function that accepts the channels
parameter to reflect the actual expected type (an object with isEmpty() and
all() methods, e.g. an AsyncAPI channels container or a Map-like wrapper)
instead of Map<string,string>, and correct the `@returns` type if needed to match
the actual returned structure (Map<string, Map<string,string>> or appropriate).
Add an `@throws` (or `@throws` {TypeError}) clause documenting that the function
will throw when channels is null/undefined or when channels.isEmpty() is true
(or when channels.all() is not a function), and mention the exact conditions
that cause the error. Apply the same JSDoc fixes to the other occurrences noted
around lines 81-83 so parameter/return types and error conditions are consistent
for the functions using channels, channels.isEmpty(), and channels.all().

In `@packages/helpers/src/index.js`:
- Line 17: The new exported helper getQueryParamsForAllChannels lacks unit
tests; add a test that parses a fixture and invokes getQueryParamsForAllChannels
with the real Parser instance (per project convention) to validate its output
across expected channels. Create a test in the helpers test suite that loads a
representative fixture from the fixtures folder, constructs/uses the real
Parser, calls getQueryParamsForAllChannels, and asserts the returned query param
objects (including edge cases you expect). Ensure the test imports the helper by
name (getQueryParamsForAllChannels) and follows existing test patterns in the
helpers package.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0eaf2a35-c6c5-45b0-aab8-b2f9675f429d

📥 Commits

Reviewing files that changed from the base of the PR and between 917a555 and 1dde58a.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • packages/helpers/src/bindings.js
  • packages/helpers/src/index.js

Comment thread packages/helpers/src/bindings.js Outdated
Comment on lines 4 to 6
* @param {Map<string,string>} channels - A Map representing all AsyncAPI channels.
* @returns {Map<string,string>} A Map whose keys are parameter names and whose values are their defaults (or `''`).
* @returns {Map<string, Map<string,string>>} A Map where keys are channel names and values are Maps of parameter names to their defaults (or `''`).
*
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix JSDoc parameter typing and document error conditions accurately.

The channels type is documented as Map<string,string>, but the code requires an object with isEmpty() and all(). Please update the JSDoc types and add explicit error-condition docs (@throws or equivalent behavior note).

As per coding guidelines **/*.{js,ts,jsx,tsx}: Write clear and consistent JSDoc comments for functions, including parameter types, return values, and error conditions.

Also applies to: 81-83

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/helpers/src/bindings.js` around lines 4 - 6, Update the JSDoc for
the function that accepts the channels parameter to reflect the actual expected
type (an object with isEmpty() and all() methods, e.g. an AsyncAPI channels
container or a Map-like wrapper) instead of Map<string,string>, and correct the
`@returns` type if needed to match the actual returned structure (Map<string,
Map<string,string>> or appropriate). Add an `@throws` (or `@throws` {TypeError})
clause documenting that the function will throw when channels is null/undefined
or when channels.isEmpty() is true (or when channels.all() is not a function),
and mention the exact conditions that cause the error. Apply the same JSDoc
fixes to the other occurrences noted around lines 81-83 so parameter/return
types and error conditions are consistent for the functions using channels,
channels.isEmpty(), and channels.all().

Comment thread packages/helpers/src/bindings.js
getServerProtocol,
listFiles,
getQueryParams,
getQueryParamsForAllChannels,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Add dedicated tests for the newly exported helper.

getQueryParamsForAllChannels is now publicly exported, but this PR does not include corresponding helper tests. Please add coverage in packages/helpers/test/**/*.test.js using fixture parsing + real Parser per project convention.

As per coding guidelines {packages/helpers/src/**/*.js,packages/helpers/test/**/*.test.js}: Every exported helper in packages/helpers needs a test. Default to parsing a fixture from test/__fixtures__/ and passing the real Parser object to the helper.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/helpers/src/index.js` at line 17, The new exported helper
getQueryParamsForAllChannels lacks unit tests; add a test that parses a fixture
and invokes getQueryParamsForAllChannels with the real Parser instance (per
project convention) to validate its output across expected channels. Create a
test in the helpers test suite that loads a representative fixture from the
fixtures folder, constructs/uses the real Parser, calls
getQueryParamsForAllChannels, and asserts the returned query param objects
(including edge cases you expect). Ensure the test imports the helper by name
(getQueryParamsForAllChannels) and follows existing test patterns in the helpers
package.

@SushanthMusham
Copy link
Copy Markdown
Contributor Author

SushanthMusham commented May 26, 2026

@Adi-204 , I have cleared the two issues raised by the code rabbit , the tests part is what left, I am trying to do it as well , it is taking a bit time, I new to writing test, nevertheless will commit the new changes by tonight ,nvm , also the jsdoc is also wrong in the current code as well , Its an object from the very first but the current comment says its a map , fixed this too

Copy link
Copy Markdown

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/helpers/test/bindings.test.js`:
- Around line 91-98: Add a JSDoc block above
getQueryParamsForAllChannelsFiltered describing the channelNames parameter and
the function return contract: document that channelNames is an array of strings
(string[]) and that the function returns the same Map-like structure produced by
createChannelsWithOnly/getQueryParamsForAllChannels (e.g., a Map of channelName
=> channelQueryParams or an object with size/all methods), including the shape
of the values (what each entry contains) and any error/edge behavior (empty
array -> empty map). Reference the function name
getQueryParamsForAllChannelsFiltered, the param channelNames, and the returned
filteredChannelsMap/getQueryParamsForAllChannels result in the JSDoc.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a9b6668e-f066-4f00-af55-11c45febb50c

📥 Commits

Reviewing files that changed from the base of the PR and between 1dde58a and 17faff9.

📒 Files selected for processing (2)
  • packages/helpers/src/bindings.js
  • packages/helpers/test/bindings.test.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/helpers/src/bindings.js

Comment thread packages/helpers/test/bindings.test.js Outdated
Copy link
Copy Markdown

@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.

♻️ Duplicate comments (1)
packages/helpers/test/bindings.test.js (1)

90-102: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add JSDoc for the new local helper function.

getFilteredAllChannelsParams is newly/actively modified but undocumented. Please add JSDoc for channelNames, return shape, and empty-input behavior.

Proposed update
+/**
+ * Filters document channels by name and returns extracted WS query params for all matching channels.
+ *
+ * `@param` {string[]} channelNames - Channel IDs to include.
+ * `@returns` {Map<string, Map<string, string>>} Map of channel name -> query param defaults.
+ * Returns an empty Map when no matching channels with WS query properties are found.
+ */
   const getFilteredAllChannelsParams = (channelNames) => {
     const channels = parsedAsyncAPIDocument.channels();
     const filteredMap = new Map();

As per coding guidelines, "**/*.{js,ts,jsx,tsx}: Write clear and consistent JSDoc comments for functions, including parameter types, return values, and error conditions".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/helpers/test/bindings.test.js` around lines 90 - 102, Add a JSDoc
block for the local helper function getFilteredAllChannelsParams describing the
channelNames parameter (Array<string> of channel IDs to include), the return
shape (the value returned by getQueryParamsForAllChannels: an object exposing
isEmpty() and all() with all() returning an array of channel objects), and the
empty-input behavior (when channelNames is empty or none match, isEmpty() should
return true and all() should return an empty array). Place the comment
immediately above the getFilteredAllChannelsParams declaration and reference
parsedAsyncAPIDocument.channels() and getQueryParamsForAllChannels in the
description so readers understand where channels are sourced and what is
returned.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@packages/helpers/test/bindings.test.js`:
- Around line 90-102: Add a JSDoc block for the local helper function
getFilteredAllChannelsParams describing the channelNames parameter
(Array<string> of channel IDs to include), the return shape (the value returned
by getQueryParamsForAllChannels: an object exposing isEmpty() and all() with
all() returning an array of channel objects), and the empty-input behavior (when
channelNames is empty or none match, isEmpty() should return true and all()
should return an empty array). Place the comment immediately above the
getFilteredAllChannelsParams declaration and reference
parsedAsyncAPIDocument.channels() and getQueryParamsForAllChannels in the
description so readers understand where channels are sourced and what is
returned.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b2972e73-2b7f-4e16-8ed7-56e8d0362d29

📥 Commits

Reviewing files that changed from the base of the PR and between 17faff9 and 02453cf.

📒 Files selected for processing (2)
  • packages/helpers/src/bindings.js
  • packages/helpers/test/bindings.test.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/helpers/src/bindings.js

@sonarqubecloud
Copy link
Copy Markdown

@SushanthMusham
Copy link
Copy Markdown
Contributor Author

@Adi-204 .
Please have a look at it, implemented getQueryParamsForAllChannels and also added tests for that function too ! , all the tests are passing .

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.

getQueryParams helper function assumes only one channel has ws bindings.

2 participants