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 open records as query param #1718

Merged
merged 8 commits into from
Jul 24, 2023
Merged

Allow open records as query param #1718

merged 8 commits into from
Jul 24, 2023

Conversation

TharmiganK
Copy link
Contributor

@TharmiganK TharmiganK commented Jul 20, 2023

Purpose

$Subject

Fixes: ballerina-platform/ballerina-library#4541

Examples

import ballerina/http;

type User record {
    int id;
    string name;
};

type UserNew record {
    int id;
    string name;
    Address address;
};

type Address record {
    int no;
    string street;
};

service /sample on new http:Listener(9090) {
    
    resource function get path1(User user) {}

    resource function post path2(@http:Query User user) {}

    resource function put path3(@http:Query record {int id; string name;} user) {}

    resource function get path4(record{|User...;|} user) {}

    resource function post path5(@http:Query UserNew user) {}
}

Checklist

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

@codecov
Copy link

codecov bot commented Jul 20, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.02 🎉

Comparison is base (244485a) 81.55% compared to head (0ca7e1d) 81.57%.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1718      +/-   ##
============================================
+ Coverage     81.55%   81.57%   +0.02%     
  Complexity      577      577              
============================================
  Files           393      393              
  Lines         21423    21422       -1     
  Branches       4796     4796              
============================================
+ Hits          17471    17475       +4     
+ Misses         2948     2944       -4     
+ Partials       1004     1003       -1     
Impacted Files Coverage Δ
...a/io/ballerina/stdlib/http/compiler/Constants.java 0.00% <ø> (ø)
...rina/stdlib/http/compiler/HttpDiagnosticCodes.java 100.00% <ø> (ø)
...a/stdlib/http/compiler/HttpCompilerPluginUtil.java 90.41% <100.00%> (-0.07%) ⬇️
...na/stdlib/http/compiler/HttpResourceValidator.java 84.18% <100.00%> (ø)

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

…r/Constants.java

Co-authored-by: Dilan Sachintha Nayanajith <[email protected]>
@sonarcloud
Copy link

sonarcloud bot commented Jul 20, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Contributor

@dilanSachi dilanSachi left a comment

Choose a reason for hiding this comment

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

LGTM

@TharmiganK TharmiganK merged commit cd45c51 into master Jul 24, 2023
@TharmiganK TharmiganK deleted the open-record-query branch July 24, 2023 03:42
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.

Requesting open record support for query parameter
2 participants