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 jsonutils module. #18474

Merged
merged 1 commit into from
Sep 5, 2019

Conversation

pramodya1994
Copy link
Contributor

@pramodya1994 pramodya1994 commented Sep 3, 2019

Purpose

This module restores removed json.toXML functionality.

import ballerina/jsonutils;

function testToXml() returns xml {
    json data = {
        name: "John",
        age: 30
    };
    xml x = jsonutils:toXML(data);
    return x;
}

x will be <name>John</name><age>30</age>

Fixes #

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

  • Read the Contributing Guide
  • Required Balo version update
  • Updated Change Log
  • Checked Tooling Support (#)
  • 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

@pramodya1994 pramodya1994 force-pushed the jsonutils-master branch 2 times, most recently from 0ff2f4c to a3c6e9c Compare September 3, 2019 12:11
@wggihan wggihan added the Team/StandardLibs All Ballerina standard libraries label Sep 3, 2019
@codecov-io
Copy link

codecov-io commented Sep 4, 2019

Codecov Report

Merging #18474 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #18474   +/-   ##
=======================================
  Coverage   15.15%   15.15%           
=======================================
  Files          48       48           
  Lines        1254     1254           
  Branches      197      197           
=======================================
  Hits          190      190           
  Misses       1050     1050           
  Partials       14       14

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b214677...1ba51a4. Read the comment docs.

This module restores removed json.toXML functionality.
@ldclakmal ldclakmal added this to the Ballerina 1.0.0-rc1 milestone Sep 5, 2019
BType type = TypeChecker.getType(json);
switch (type.getTag()) {

case TypeTags.MAP_TAG:
Copy link
Contributor

Choose a reason for hiding this comment

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

incorrect formatting

@wggihan wggihan merged commit 83defa2 into ballerina-platform:master Sep 5, 2019
@keizer619 keizer619 modified the milestones: Ballerina 1.0.0-rc1, Ballerina 1.0.0 Oct 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team/StandardLibs All Ballerina standard libraries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants