Skip to content

Commit b841801

Browse files
authored
Merge pull request #243 from AzureCosmosDB/fix/237-multidim-array-support
Fix #237 - Support multi-dimensional arrays in DataItemJsonConverter (supersedes #238)
2 parents d61cecd + 0b4109a commit b841801

4 files changed

Lines changed: 558 additions & 56 deletions

File tree

Extensions/Json/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,15 @@ Additionally, an optional `ItemProgressFrequency` parameter (`1000` by default)
4343
"ItemProgressFrequency": 1000
4444
}
4545
```
46+
47+
## Notes
48+
49+
### Multi-dimensional arrays
50+
51+
Multi-dimensional (nested) arrays are supported on write. This includes GeoJSON geometries such as `LineString` (2-D), `Polygon` (3-D), and `MultiPolygon` (4-D) `coordinates`. Documents that previously emitted `"System.Collections.Generic.List``1[System.Object]"` placeholders for these shapes now serialize correctly.
52+
53+
### Maximum nesting depth
54+
55+
To guard against pathological or recursively nested input (which would otherwise stack-overflow the host process), JSON serialization enforces a **maximum combined object + array nesting depth of 64**. Documents that exceed this limit are rejected with an `InvalidOperationException` whose message contains the phrase `nesting depth`.
56+
57+
This limit is well above any realistic document — GeoJSON `MultiPolygon` reaches depth 5, and typical nested business documents are under depth 10 — but if you hit it, it almost always indicates a corrupt or self-referential source document.

Extensions/SqlServer/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Source and sink settings both require a `ConnectionString` parameter.
1010

1111
If surfacing data as JSON, the `JsonFields` parameter can be used to specify which fields should be treated as JSON strings. This is useful for building nested sets of data that should be handled as a nested object downstream.
1212

13+
> **Note**: Nested objects written into a SQL column as a JSON string go through the shared JSON serializer and are subject to a **maximum combined object + array nesting depth of 64**. Sources exceeding this limit will fail with an `InvalidOperationException`. See the [JSON extension notes](../Json/README.md#notes) for details.
14+
1315
### Source
1416

1517
Source settings also require either a `QueryText` or `FilePath` parameter with the SQL statement that defines the data to select.

0 commit comments

Comments
 (0)