ballerina-platform / ballerina-library

The Ballerina Library
https://ballerina.io/learn/api-docs/ballerina/
Apache License 2.0
136 stars 64 forks source link

Support default values for query parameter in Websocket service #7017

Open MohamedSabthar opened 1 month ago

MohamedSabthar commented 1 month ago

Description: The current WebSocket implementation doesn't support default values for query parameters. We need to add support for default values, similar to how the HTTP module handles default value implementation.

Ideally we should support the below

service /chat on new websocket:Listener(9099) {

    // The `userName` query param with default value
    resource function get .(string userName = "un") returns websocket:Service {
        return new ChatService(userName.toString());
    }
}

Describe your problem(s)

Describe your solution(s)

Related Issues (optional):

Suggested Labels (optional):

Suggested Assignees (optional):