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

Allow records to be annotated with @http:Header #2699

Closed
shafreenAnfar opened this issue Feb 17, 2022 · 0 comments · Fixed by ballerina-platform/module-ballerina-http#935
Closed
Assignees
Labels
module/http Points/3 Team/PCM Protocol connector packages related issues Type/Improvement
Milestone

Comments

@shafreenAnfar
Copy link
Contributor

This is related to Proposal [1]. Instead of doing the below,

resource function get hello(@http:Header string x\-rate\-limit\-id,  @http:Header int x\-rate\-limit\-remaining, @http:Header string[] x\-rate\-limit\-types) returns string {
}

Users should be able to do the below,

public type RateLimitHeaders record {|
    string x\-rate\-limit\-id;
    int x\-rate\-limit\-remaining;
    string[] x\-rate\-limit\-types;
|};

resource function get hello(@http:Headers RateLimitHeaders rateLimitHeaders) returns string {
}

[1] https://github.com/ballerina-platform/module-ballerina-http/blob/master/docs/proposals/typed-headers.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/http Points/3 Team/PCM Protocol connector packages related issues Type/Improvement
Projects
No open projects
Status: StandardLib-PCM
2 participants