BsonDocument exceeds the JsonSerializerOptions.MaxDepth setting
Type
running the project returns
System.InvalidOperationException: The depth of the generated JSON schema exceeds the JsonSerializerOptions.MaxDepth setting.
I'm using Scalar.AspNetCore
for this with default MapOpenApi
I tried doing as well but nothing helps.
3 Replies
This is related to openapi when trying to access it:
Ok - so I found a solution that works now.
Create new class
BsonJsonConverter
change where BsonDocument is to this
and in your Program.cs of your API add this
BsonDocument becomes kind of empty not really any docs for it generates, but at least it does not cause errors there is probably better way to do this

Returning/saving works fine though
