0

There are many articles about BizTalk JSON encoder...

I am trying to produce JSON for 3rd party software wanting root level array, like so:

[
   { 
     "property" : "value"
   },
   {
     "property" : "value" 
   }
]

I am trying to control the output using schema, but I am not able to specify minOccurs and maxOccurs on the root node. I have also tried "Group Max/Min Occurs", with no difference.

Is it not possible to do this? What about the old newtonsoft hack for adding Array attribute to the output XML? (I have tried this as well, but failed...)

Dijkgraaf
  • 11,049
  • 17
  • 42
  • 54
JERKER
  • 907
  • 8
  • 17

1 Answers1

1

This is similar to BizTalk 2013 - decode JSON array

As per the answers on the other question, you can't have an array at the root node of an XML schema. That one is for receiving a JSON payload with an array at the root, rather then sending one. But your options are similar, you would need to either have a custom pipeline component after the JSON encoder that removes the root or a custom pipeline component that produces the JSON the way you want.

Dijkgraaf
  • 11,049
  • 17
  • 42
  • 54
  • Yes, post-JSON encode custom pipeline component... Do you know if newtonsoft is still used by BizTalk 2020? The Array attribute solution does not work anyway... – JERKER Mar 18 '21 at 21:01
  • 1
    @JERKER Yes, Newtonsoft.Json version 12.0.3 with CU1 – Dijkgraaf Mar 18 '21 at 22:09