Skip to content

Failed to connect to a websocket connection which accept a parameter with an Enum type #4765

@SasinduDilshara

Description

@SasinduDilshara
import ballerina/log;
import ballerina/websocket;

enum wsType {
    ORDER_TYPE,
    CARGO_TYPE
}

service /ws on wsListener {
    resource function get .(string id, wsType 'type) returns websocket:Service {
        if 'type == ORDER_TYPE {
            return new OrderService(id);
        } else {
            return new CargoService(id);
        }
    }
}

When I try to connect to the above websocket connection, It gives the 404 status code.
When I convert 'type parameter to the string type it worked successfully.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions