Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-5301

JSONProvider should add an array key for root if arrayKeys is not empty but top level array has to be produced

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0-milestone1, 2.7.8, 2.6.11
    • Component/s: None
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      Setting dropRootElement to true, dropRootElementInXmlStream to false and serializeAsArray is sufficient to do a top level array serialization, example,

      [{"someobject":{"a":"value"}}]
      

      However if someobject is also expected to be an array the setting "arrayKeys" properties loses top level '[]':

      {"someobject":[{"a":"value"}]}
      

      Fixing it will lead to

      [{"someobject":[{"a":"value"}]]
      

        Attachments

          Activity

            People

            • Assignee:
              sergey_beryozkin Sergey Beryozkin
              Reporter:
              sergey_beryozkin Sergey Beryozkin
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: