OpenApi generator messes up $ref of collection item if that type is used multiple times in same response #60779
Closed
1 task done
Labels
area-minimal
Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc
feature-openapi
Is there an existing issue for this?
Describe the bug
Microsoft.AspNetCore.OpenApi v9.0.2
When response type references same type indirectly as collection elements more than once, all $refs but first gets messed up. It tries pointing to array element of first encountered one. See example bellow
Opening open API json would show spec like so:
Expected Behavior
No response
Steps To Reproduce
Simple repo with code mentioned above: https://github.com/Madajevas/OpenApiComponentReuseIssue/blob/master/OpenApiComponentReuseIssue/Program.cs
Exceptions (if any)
No response
.NET Version
9.0.200
Anything else?
No response
The text was updated successfully, but these errors were encountered: