Skip to content

Commit 3d81e1e

Browse files
Merge pull request #286321 from dlepow/xmlj
[APIM] New attribute for xml-to-json
2 parents cdcfec3 + dd76700 commit 3d81e1e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

articles/api-management/xml-to-json-policy.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: dlepow
66

77
ms.service: azure-api-management
88
ms.topic: article
9-
ms.date: 07/23/2024
9+
ms.date: 09/06/2024
1010
ms.author: danlep
1111
---
1212

@@ -21,7 +21,7 @@ The `xml-to-json` policy converts a request or response body from XML to JSON. T
2121
## Policy statement
2222

2323
```xml
24-
<xml-to-json kind="javascript-friendly | direct" apply="always | content-type-xml" consider-accept-header="true | false"/>
24+
<xml-to-json kind="javascript-friendly | direct" apply="always | content-type-xml" consider-accept-header="true | false" always-array-children="true | false"/>
2525
```
2626

2727

@@ -32,6 +32,7 @@ The `xml-to-json` policy converts a request or response body from XML to JSON. T
3232
|kind|The attribute must be set to one of the following values.<br /><br /> - `javascript-friendly` - the converted JSON has a form friendly to JavaScript developers.<br />- `direct` - the converted JSON reflects the original XML document's structure.<br/><br/>Policy expressions are allowed.|Yes|N/A|
3333
|apply|The attribute must be set to one of the following values.<br /><br /> - `always` - convert always.<br />- `content-type-xml` - convert only if response Content-Type header indicates presence of XML.<br/><br/>Policy expressions are allowed.|Yes|N/A|
3434
|consider-accept-header|The attribute must be set to one of the following values.<br /><br /> - `true` - apply conversion if JSON is requested in request Accept header.<br />- `false` -always apply conversion.<br/><br/>Policy expressions are allowed.|No|`true`|
35+
|always-array-children|The attribute must be set to one of the following values.<br /><br /> - `true` - Always convert child elements into a JSON array.<br />- `false` - Only convert multiple child elements into a JSON array. Convert a single child element into a JSON object.<br/><br/>Policy expressions are allowed.|No|`false`|
3536

3637
## Usage
3738

0 commit comments

Comments
 (0)