-
Notifications
You must be signed in to change notification settings - Fork 17
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
Integrate websockets
protocol support
#119
Conversation
…essageImpl of apicurio model
asyncapi-cli/src/main/java/io/ballerina/asyncapi/cmd/websockets/AsyncAPIDiagnostic.java
Outdated
Show resolved
Hide resolved
samples/basic-chat/client-with-dispatcherStreamId/asyncapi.yaml
Outdated
Show resolved
Hide resolved
_ = users.remove(callerId); | ||
} | ||
|
||
// remote function onClose(websocket:Caller caller) returns websocket:Error? { |
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.
Any particular reason for commenting out these lines? I think it's better if we have this part as well. To remove the users from the map when the connection is closed by the client.
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.
The reason for this is that AsyncAPI tools currently doesn't support built-in functions in the ballerina/websocket
library.
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.
Hmm, I am not sure whether I understood this. But this onClose
is there in the WebSocket module which gets dispatched when there is a connection closure frame from the client. This does not have to be related to AsyncAPI tools right?
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.
Yes, but according to this function [1], we are explicitly disallowing built-in methods in the websocket service
. This may be due to the difficulty of mapping the responses of these functions.
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.
Ohh, this is wrong. We should not throw any errors if those functions are there, we basically have to skip(ignore) them when generating the Async API. Will create an issue for this. Thanks for explaining.
Purpose
This is to integrate
websockets
protocol support for client generation with AsyncAPI specification and vice versa. Moreover, this also upgrades the APICurio version to the latest version (2.0.4) as well.Fixes:
Related Issues
ballerina-platform/ballerina-library#4290