[backend/asp] Increase JsonSerializer MaxDepth to 256

200 is the maximum required by the note descendants/ascendants tree, so 256 is that + some margins. Cycle detection is unaffected by this change.
This commit is contained in:
Laura Hausmann 2024-10-03 00:43:46 +02:00
parent 9d1a21e2d9
commit c1e348b0d5
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -171,6 +171,7 @@ public static class ServiceExtensions
services.Configure<Microsoft.AspNetCore.Mvc.JsonOptions>(options =>
{
options.JsonSerializerOptions.PropertyNamingPolicy = JsonSerialization.Options.PropertyNamingPolicy;
options.JsonSerializerOptions.MaxDepth = 256;
foreach (var converter in JsonSerialization.Options.Converters)
options.JsonSerializerOptions.Converters.Add(converter);
});