Incorrect OpenAPI Schema Generation for Recursive Types #61139
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
We encountered an issue where ASP.NET Core incorrectly generates OpenAPI json schema for recursive types. Specifically, the generated schema for a recursive model (Nav) is valid, but when attempting to define a separate object (Nav2) that references an array of items, it incorrectly resolves the $ref path.
Expected Behavior
The generated OpenAPI schema should correctly resolve $ref references for recursive types, ensuring Nav2.children.items properly refers to the Nav schema.
Steps To Reproduce
Exceptions (if any)
No response
.NET Version
9.0.3
Related issues
Recursive data models inside collections yield invalid schema references #59879
.NET 9 OpenAPI produces lots of duplicate schemas for the same object #58968
The text was updated successfully, but these errors were encountered: