-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NSwagStudio error while generating: Newtonsoft.Json.JsonReaderException: The reader's MaxDepth of 64 has been exceeded. #4394
Comments
Hi @fbede4, did you ever find a solution to this? I'm thinking that NSwag uses Newtonsoft to parse the schema, no matter which library you chose to generate the client. I'm having the same issue and nothing I change in my project makes a difference because it happens before that is even evaluated. |
Here's some background: https://stackoverflow.com/questions/68576787/newtonsoft-getting-the-readers-maxdepth-of-64-has-been-exceeded-error-while Somebody should probably send a PR tweaking the JSON loading in NSwagStudio. |
@lahma Isn't this rather an issue in NSwag.Core / NJsonSchema? Specifically this line: https://github.com/RicoSuter/NSwag/blob/9175311f5427ccc899098971c8a4dd2353a1400a/src/NSwag.Core/OpenApiDocument.cs#L204C73-L204C73 This is the full stack trace I get when trying to generate code (it does not even get to this part because it fails to parse the schema):
|
Yes it might very well be |
I made a PR over at NJsonSchema (see reference above). Like I write there, it would maybe be more useful to expose a way of modifying the serializer settings to external callers, NSwag in this case, instead of modifying it for everyone. |
v14 |
While generating the C# contracts for an API, I ran into the following error:
The weird thing is that I have set System.Text.Json to be the JSON library.
Is there any way to fix this issue?
The text was updated successfully, but these errors were encountered: