Azure / azure-cosmos-dotnet-v3

.NET SDK for Azure Cosmos DB for the core SQL API
MIT License
723 stars 477 forks source link

[Internal] JsonObjectState: Refactors to allow dynamically increasing JsonMaxNestingDepth #4542

Open sc978345 opened 2 weeks ago

sc978345 commented 2 weeks ago

Description

This PR modifies Json object state to support dynamically increasing the maximum nesting depth. This will allow serialization/deserialization of Json with deeply nested objects or arrays. This is needed because distribution plans may contain expressions that are deeply nested beyond the current limit.

Previously, there was a hardcoded limit of 256 for JsonMaxNestingDepth. With this change, if the limit is reached, JsonObjectState will dynamically increase the value until the supported limit of 2^15 (32k) is reached

Type of change