ballerina-lang
ballerina-lang copied to clipboard
Improve JSON to Record Conversion
Purpose
I modified both
json-mapperandjson-to-record-converter(in the Language Server) to have the desired behaviour from the issue. Records are now always closed and might have a rest field withjson...;. Also, noanyoranydatais produced but onlyjson.
Fixes #42610
Approach
Describe how you are implementing the solutions along with the design details.
Samples
Provide high-level details about the samples related to this feature.
Remarks
List any other known issues, related PRs, TODO items, or any other notes related to the PR.
Check List
- [x] Read the Contributing Guide
- [ ] Updated Change Log
- [ ] Checked Tooling Support (#<Issue Number>)
- [ ] Added necessary tests
- [ ] Unit Tests
- [ ] Spec Conformance Tests
- [ ] Integration Tests
- [ ] Ballerina By Example Tests
- [ ] Increased Test Coverage
- [ ] Added necessary documentation
- [ ] API documentation
- [ ] Module documentation in Module.md files
- [ ] Ballerina By Examples
There is a checkstyle failure as well, shall we check that as well?
I was a bit unsure about the open/closeness of the records since in the json-mapper the isClosed is also applied into inner records but in the language server json-to-record-converter this is only applied on the outer most level and all inner records were open. I now adjusted the language server module to be the same as json-mapper since I think this approach makes more sense.
Codecov Report
Attention: Patch coverage is 84.11215% with 17 lines in your changes missing coverage. Please review.
Project coverage is 77.55%. Comparing base (
68e12c3) to head (66f7b52). Report is 40 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #43482 +/- ##
============================================
- Coverage 77.55% 77.55% -0.01%
+ Complexity 58723 58722 -1
============================================
Files 3447 3447
Lines 219656 219658 +2
Branches 28917 28915 -2
============================================
+ Hits 170364 170365 +1
- Misses 39891 39892 +1
Partials 9401 9401
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@Shadow-Devil Shall we fix the code conflict please?
@gimantha code conflicts are fixed and pipeline was successful