-
Notifications
You must be signed in to change notification settings - Fork 37
fix(websocket): add support for enum (finite) types in query parameters #1587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Itz-Agasta <[email protected]>
Signed-off-by: Itz-Agasta <[email protected]>
|
HI @ThisaruGuruge, As mentioned in the issue i updated the |
ThisaruGuruge
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add tests for test this functionality.
native/src/main/java/io/ballerina/stdlib/websocket/QueryParam.java
Outdated
Show resolved
Hide resolved
native/src/main/java/io/ballerina/stdlib/websocket/WebSocketResourceDispatcher.java
Outdated
Show resolved
Hide resolved
native/src/main/java/io/ballerina/stdlib/websocket/WebSocketResourceDispatcher.java
Outdated
Show resolved
Hide resolved
native/src/main/java/io/ballerina/stdlib/websocket/WebSocketResourceDispatcher.java
Outdated
Show resolved
Hide resolved
|
Hi @ThisaruGuruge, I'm having some issue while trying to test the enum query param test file. The Gradle build is failing with authentication errors for GitHub Maven packages: This is preventing me from building the native JARs and running the tests. Ig as a contributor, I don't have access to the necessary tokens or permissions for the Ballerina organization's private packages. can y tell me how cam i set up their environment for testing? Or run the tests on your end to verify the enum query param functionality works? |
Hi, I am extremely sorry, the repo is missing this on the README. (Can you please create an issue for this as well?) The issue you are facing is due to GitHub package resolution. To pull packages from GitHub packages, you need to set up your GitHub username and a Personal Access Token (PAT). These should be saved as environment variables so that the Gradle script picks them. You should have the following environment variables: When you are creating the GitHub PAT, make sure to include package (read) permissions in order to build script to pull packages from the GitHub packages. Thanks. |
|




Purpose
Fix handling of enum (finite) types in WebSocket resource query parameters. Previously, enum typed query parameters were rejected at runtime and resulted in a
404 handshakefailure. This change adds native support (Java) for detecting and converting enum query parameter values so that services can accept and receive enum values from the WebSocket upgrade request.Fixes: ballerina-platform/ballerina-library#4765
Examples
Before (failed at runtime):
Failed Connection:
ws://localhost:9090?type=ORDER_TYPE→ 404 Not FoundError Message:
"Invalid query param type 'wsType'"After (works):
Checklist
Signed-off-by: Itz-Agasta [email protected]