Incorrect OpenAPI document generation with recursive object that contains a list #60012
Open
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
In a .NET 9.0.1 Minimal API project with Microsoft.AspNetCore.OpenApi, I have the following endpoint, returning a recursive object that also contains a list:
With this code, the OpenAPI definition is wrong:
If I remove the
Parent
property fromCategory
, the document is correctly generated:Note that the issue happens even when using a primitive type for the collection (for example
string
).Expected Behavior
No response
Steps To Reproduce
Minimal repro at https://github.com/marcominerva/RecursiveObjectIssue.
Exceptions (if any)
No response
.NET Version
9.0.102
Anything else?
No response
The text was updated successfully, but these errors were encountered: