Closed msmaiaa closed 1 month ago
The reason is because you have MySecondStruct
in MyFirstStruct
and MyFirstStruct
in MySecondStruct
, and as you can see when we expand the macros, the ToSchema::to_schema will call ToSchema::to_schema of its fields (Our fields is in each other = infinity call)
@chrislearn May this debug helps you, or you can explain to me how to fix it, I'll fix it if I can.
ToSchema::to_schema
implantation (by the `ToSchema` derive macro)@TheAwiteb Thanks, I'm refactoring openapi and this bug will be fixed in the next few days.
Describe the bug When using recursive structs with the open api router the program outputs this error: "thread 'main' has overflowed its stack".
To Reproduce Steps to reproduce the behavior:
Expected behavior I expected to not crash
Desktop (please complete the following information):
Additional context The program runs just fine if i use the "handler" macro instead of "endpoint".