Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-19958

EMPTY TAGS IN XML AND NULL VALUES IN JSON VR.2.3.17#3942

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not a Bug
    • Major
    • None
    • None
    • Atlas Map
    • None
    • True
    • None
    • False
    • Documentation (Ref Guide, User Guide, etc.), Release Notes, Compatibility/Configuration, User Experience
    • % %
    • Todo
    • Hide

      To Reproduce
      1.For JSON to XML please use the file in the zip attached
      2.For XML to JSON please use the file in the zip attached

      Expected behavior

      1. For JSON to XML: No empty tags in XML
      2. For XML to JSON: No null values in JSON

      Environment (please complete the following information):

      • OS: Windows 10
      • Browser Edge
      Show
      To Reproduce 1.For JSON to XML please use the file in the zip attached 2.For XML to JSON please use the file in the zip attached Expected behavior For JSON to XML: No empty tags in XML For XML to JSON: No null values in JSON Environment (please complete the following information): OS: Windows 10 Browser Edge

    Description

      While mapping from json to xml,

      JSON:

      { "lock": [ \{ "name": "?", "value": "?" }

      ],
      "hold": [
      {
      "name": "hold",
      "value": "0"
      }
      ]
      }{{}}
      XML:
      <unn:lock>
      <!-1 or more repetitions:->
      <unn:item>
      <unn:name>?</unn:name>
      <unn:value>?</unn:value>
      </unn:item>
      </unn:lock>
      <unn:hold>
      <!-1 or more repetitions:->
      <unn:item>
      <unn:name>?</unn:name>
      <unn:value>?</unn:value>
      </unn:item>
      </unn:hold>{{}}
      We're mapping lock(collection)/name to lock/item(collection)/name and lock(collection)/value to lock/item(collection)/value. Simarly for hold.

      In case that we don't send lock in our json request, we're getting an empty tag for it.

      Current output:
      <lock/>
      <hold>
      <item>
      <name>hold</name>
      <value>0</value>
      </item>
      </hold>{{}}
      Expected Output:
       
      <hold>
      <item>
      <name>hold</name>
      <value>0</value>
      </item>
      </hold>
      Similarly, while mapping XML to JSON:

      XML:
      </soapenv:Header>
      <soapenv:Body>
      <cai3:SetResponse>
      <!-Optional:->
      <cai3:MOAttributes>
      </cai3:MOAttributes>
      <!-Optional:->
      <cai3:Status>
      <cai3:ResultCode>?</cai3:ResultCode>
      <cai3:Description>?</cai3:Description>
      </cai3:Status>
      </cai3:SetResponse>
      </soapenv:Body>
      </soapenv:Envelope>{{ }}
      JSON:
      {
      "SetResponse": {
      "Status":

      { "ResultCode": "?", "Description": "?" }

      }
      }{{}}
      In case ResultCode in not present in XML we're getting null value in json.

      Current Output:
      {
      "SetResponse": {
      "Status":

      { "ResultCode": null, "Description": "?" }

      }
      }{{}}
       {{}}
      Expected Output:
      {
      "SetResponse": {
      "Status":

      { "Description": "?" }

      }
      }{{}}
       

      Attachments

        Activity

          People

            toigaras@redhat.com tomohisa igarashi
            rh-ee-maanand Manu Anand
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1 week, 2 days
                1w 2d
                Remaining:
                Remaining Estimate - 1 week, 2 days
                1w 2d
                Logged:
                Time Spent - Not Specified
                Not Specified