Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
✅ How to avoid stackoverflow exception in multiple recursion - C#
C
C#
•
3y ago
SWEETPONY
✅ How to avoid stackoverflow exception in multiple recursion
I
'm trying to make custom OpenApiSchema generator
.
How it works
:
https://gist.github.com/INTERNALINTERFERENCE/34b809883d74a252ac4326a18fbce93b
So
ApiArgument
ApiArgument
,
ApiReturn
ApiReturn
represent DTOs
. All I need is to create
OpenApiSchema
OpenApiSchema
by this model
.
I have three problems
:
1
. I can generate OpenApiSchema for one type several times
, I don
't control this
, and I don
't understand how to do it
.
.
2
. We can have cycle in dto
, thats why stackoverflow exception
. For example
: we have
SubjectDto
SubjectDto
and
DepartmentDto
DepartmentDto
.
SubjectDto
SubjectDto
has reference to
DepartmentDto
DepartmentDto
and
DepartmentDto
DepartmentDto
has reference to
SubjectDto
SubjectDto
3
. It is really hard to read
.
.
.
.
Gist
.cs
GitHub Gist
: instantly share code
, notes
, and snippets
.
C#
Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
❔ Avoid infinite recursion in STJ converters
C
C# / help
3y ago
❔ How to avoid multiple loop of collection?
C
C# / help
3y ago
❔ StackOverFlow bug
C
C# / help
4y ago
recursion
C
C# / help
16mo ago