asyncapi / asyncapi/generator

Dart WebSocket client template doesn't support query parameters from channel bindings

Open
#1,958 10 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.1k
Forks
397
Avg merge
1d 7h
Merged PRs (30d)
25

Description

The Dart WebSocket client template doesn't extract or use query parameters defined in channel bindings, unlike the Python template. This prevents authentication tokens and other important parameters from being passed to WebSocket connections.

When a channel defines query parameters in its bindings (e.g., `auth_token` for authentication), the generated JavaScript client should:
1. Accept these parameters in the constructor
2. Automatically append them to the WebSocket URL as query strings

```dart
// Expected generated code
ExampleClient({String? url, String? auth_token})
: _url = _buildUrl(url ?? 'wss://default-url', auth_token);

static String _buildUrl(String baseUrl, String? authToken) {
if (authToken == null) return baseUrl;
return '$baseUrl?auth_token=$authToken';
}

Contributor guide

Open the contributing guide

Research direction

Start with the Dart WebSocket client template and compare its handling of channel bindings with the Python template. Verify the generated constructor accepts binding query parameters and that generated WebSocket URLs include those parameters, then run the template's available tests or generation checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.