Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-18548

JSON serialization/deserialization issue with properties that have attributes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.0.0
    • Component/s: JLib
    • Labels:
      None

      Description

      Example input XML:

      <__unnamed__>
       <prop>textval1</prop>
       <prop>textval2</prop>
       <prop attr="3">
        textval3
       </prop>
       <prop>textval4</prop>
      </__unnamed__>
      

      converted to IPT.

      serialize to JSON:

      {
       "prop": [
        "textval1",
        "textval2",
        {
         "@attr": "3",
         "#value": "textval3"
        },
        "textval4"
       ]
      }
      

      back to IPT.
      Serialize to XML to show result:

      <__object__>
       <prop>textval1</prop>
       <prop>textval2</prop>
       <prop attr="3">
        <#value>textval3</#value>
       </prop>
       <prop>textval4</prop>
      </__object__>
      

      The value of prop[3] was lost and converted to a sub property named "#value".

        Attachments

          Activity

            People

            • Assignee:
              jakesmith Jake Smith
              Reporter:
              jakesmith Jake Smith
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: