C
C#17mo 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, ApiReturn represent DTOs. All I need is to create 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 and DepartmentDto. SubjectDto has reference to DepartmentDto and DepartmentDto has reference to SubjectDto 3. It is really hard to read....
Gist
.cs
GitHub Gist: instantly share code, notes, and snippets.
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server