Commit d04cc9b
Fix #237 - Support multi-dimensional arrays in DataItemJsonConverter
Refactor WriteFieldValue to handle nested (multi-dimensional) arrays via a
dedicated WriteArrayItems / WriteArrayItemValue pair instead of recursing back
into WriteFieldValue with a sentinel empty-string field name. This:
- Restores GeoJSON support: Polygon/MultiPolygon `coordinates` arrays (depth
3+) now serialize correctly instead of falling back to
`System.Collections.Generic.List`1[System.Object]`.
- Removes the implicit `IsNullOrWhiteSpace(propertyName)` sentinel so legitimate
empty-string and whitespace property names are preserved.
- Adds a MaxJsonDepth (64) guard that throws InvalidOperationException for
pathological / recursively nested input instead of stack-overflowing the host
process.
Tests:
- 17 new tests in DataItemJsonConverterTests covering GeoJSON Point/LineString/
Polygon, the full issue-237 document, mixed scalars/nulls/IDataItems inside
nested arrays, dictionary-of-dictionary nested arrays, wide-array smoke,
empty/whitespace property-name regression guards, deserialize/re-serialize
round-trip, and depth-guard at and over the limit (arrays, objects, mixed).
- All 125 Common.UnitTests pass; full solution test suite is green.
Supersedes #238. Original fix authored by Mart Lankamp - thanks!
Closes #237
Co-authored-by: Mart Lankamp <mart.lankamp@users.noreply.github.com>1 parent d61cecd commit d04cc9b
2 files changed
Lines changed: 544 additions & 56 deletions
File tree
- Interfaces
- Cosmos.DataTransfer.Common.UnitTests
- Cosmos.DataTransfer.Common
0 commit comments