Skip to content
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

Introduce dynamic parameter order for the websubhub:Service remote methods #1082

Merged
merged 6 commits into from
Feb 18, 2025

Conversation

ayeshLK
Copy link
Member

@ayeshLK ayeshLK commented Feb 17, 2025

Purpose

$subject

Fixes: #7600

Examples

Previously, websubhub:Service only supported a fixed parameter order:

service /websubhub on securedListener {

    remote function onRegisterTopic(websubhub:TopicRegistration message, http:Headers headers)
                                returns websubhub:TopicRegistrationSuccess|websubhub:TopicRegistrationError {
        
        // logic to be executed
    }

    // other methods
}

With the latest update, parameter order in remote methods is now flexible. At runtime, parameters will be dynamically identified, allowing method signatures to be reordered. For example, the following is now valid:

service /websubhub on securedListener {

    remote function onRegisterTopic(http:Headers headers, websubhub:TopicRegistration message)
                                returns websubhub:TopicRegistrationSuccess|websubhub:TopicRegistrationError {
        
        // logic to be executed
    }

    // other methods
}

Checklist

  • Linked to an issue
  • Updated the changelog
  • Added tests
  • Updated the spec
  • Checked native-image compatibility

@ayeshLK ayeshLK marked this pull request as draft February 17, 2025 13:25
@ayeshLK ayeshLK marked this pull request as ready for review February 17, 2025 14:14
@ayeshLK ayeshLK requested review from daneshk, ThisaruGuruge, Nuvindu and TharmiganK and removed request for shafreenAnfar and NipunaRanasinghe February 17, 2025 14:15
Copy link
Member

@ThisaruGuruge ThisaruGuruge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ayeshLK ayeshLK merged commit d269bd6 into ballerina-platform:main Feb 18, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce dynamic parameter order for the websubhub:Service remote methods
2 participants