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

Add constraint validation #21

Merged
merged 12 commits into from
Jul 31, 2024
Merged

Conversation

prakanth97
Copy link
Contributor

Purpose

Fixes: #6559

Examples

Checklist

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

hasithaa
hasithaa previously approved these changes Jun 6, 2024
Copy link

codecov bot commented Jun 14, 2024

Codecov Report

Attention: Patch coverage is 73.68421% with 10 lines in your changes missing coverage. Please review.

Project coverage is 86.66%. Comparing base (5ee8371) to head (28d40fa).
Report is 66 commits behind head on main.

Files Patch % Lines
...io/ballerina/lib/data/xmldata/utils/DataUtils.java 54.54% 2 Missing and 3 partials ⚠️
...a/io/ballerina/lib/data/xmldata/xml/XmlParser.java 62.50% 3 Missing ⚠️
...o/ballerina/lib/data/xmldata/xml/XmlTraversal.java 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main      #21      +/-   ##
============================================
- Coverage     87.13%   86.66%   -0.48%     
- Complexity      468      512      +44     
============================================
  Files            21       22       +1     
  Lines          2083     2234     +151     
  Branches        462      495      +33     
============================================
+ Hits           1815     1936     +121     
- Misses          162      173      +11     
- Partials        106      125      +19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

@github-actions github-actions bot added the Stale label Jun 29, 2024
@prakanth97 prakanth97 removed the Stale label Jul 1, 2024
Copy link

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

@SasinduDilshara
Copy link
Contributor

@prakanth97 PR contains conflicts


public static final MapType JSON_MAP_TYPE = TypeCreator.createMapType(PredefinedTypes.TYPE_JSON);
public static final ArrayType JSON_ARRAY_TYPE = TypeCreator.createArrayType(PredefinedTypes.TYPE_JSON);
public static final QualifiedName EXIT_REST_POINT = new QualifiedName("", "$exitRestPoint$", "");

Choose a reason for hiding this comment

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

what is the use of this constant?

Copy link
Contributor Author

@prakanth97 prakanth97 Jul 25, 2024

Choose a reason for hiding this comment

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

Assume following expected type,

type A record {|
    record {|
        record {|
            json...;
        |}...;
    |}...;
|};

We used this to exit from each rest type scope.

How we handle the rest type is wrong. I have fix this in this PR https://github.com/ballerina-platform/module-ballerina-data.xmldata/pull/26/files#diff-ad9f60570df671743210dd195978175e7b8fd93b1ad5dff8f112a158d3a3ba5a where this is not required hence removed EXIT_REST_POINT constant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not introduced in this PR, I just rearranged the constants.

@prakanth97 prakanth97 merged commit ab3dfe3 into ballerina-platform:main Jul 31, 2024
5 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.

Add constraint validation for data conversion apis in the data.xmldata
4 participants