-
Notifications
You must be signed in to change notification settings - Fork 253
[V3] Incorrect reference types for classes with more than one collection properties of the same reference type #2254
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
Comments
@captainsafia We looked through this and we are not sure where the source of this error is coming from. It appears that the $ref in balances is generated correctly, but assets and equities is wrong. It feels like the wrong Id value is being provided to the OpenAPIReference when being constructed. |
@darrelmiller as you said, 'balances' points to the correct schema type while the others that are of the same reference type do not. If I use Swashbuckle.AspNetCore package, it generates the $ref correctly for all 3 of them. |
@darrelmiller any timeline on a fix to this issue? It seems like a very easy to recreate bug to me and if you look at the source I attached, it's quite basic and nothing complicated going on there. So if I am guessing, this seems like an issue in "Microsoft.AspNetCore.OpenApi" package. |
@captainsafia can you please help confirm if this is an AspNetCore.OpenApi package issue? |
@MaggieKimani1 This came up in one of our online syncs a while back. TL;DR: this is an issue in Microsoft.AspNetCore.OpenApi for .NET 9 that was resolved in servicing. However, variants of this bug still exist with the new reference resolution in .NET 10. That's tracked in #2062. |
Closing as it is fixed in 9.0.400 release of ASP.NET Core: dotnet/aspnetcore#60381 |
Describe the bug
For response models that contain multiple collection properties referring to the same collection type, the generated document contains invalid schema references for all but one of those properties.
OpenApi File To Reproduce
SampleOpenApi_v1.0.json
Expected behavior
All the properties should point to the correct schema reference type
Screenshots/Code Snippets
Invalid schema reference types in the generated open api document
I have created a sample project here to reproduce the issue.
The text was updated successfully, but these errors were encountered: