Skip to content

OpenAPI generation *still* doesn't work with the simplest model with multiple collections in .net 9 #62079

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

Open
1 task done
tijs-hendriks-mosadex opened this issue May 23, 2025 · 2 comments
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-openapi

Comments

@tijs-hendriks-mosadex
Copy link

tijs-hendriks-mosadex commented May 23, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Using .net 9 and Microsoft.Extensions.ApiDescription.Server v9.0.5

This model:

public class TestModel
{
    public SubModel[] First { get; set; }
    public SubModel[] Second { get; set; }
}

public class SubModel
{
    public string Name { get; set; }
}

Generates this definition:

"TestModel": {
  "type": "object",
  "properties": {
    "first": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/SubModel"
      }
    },
    "second": {
      "type": "array",
      "items": { } <<<<< NO TYPE REF HERE?
    }
  }
}

This is now the third time we've been waiting on a new release that was expected to include a fix for this issue. Given the ASP.NET release cadence, these delays are becoming quite impactful for us - we have multiple branches waiting that depend on this functionality.

Even very simple models are failing to work as expected. I had previously submitted this exact model in an earlier bug report: #60931

Could you clarify whether OpenAPI generation is currently considered stable and suitable for production use?

@github-actions github-actions bot added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label May 23, 2025
@martincostello
Copy link
Member

Could you clarify whether OpenAPI generation is currently considered stable and suitable for production use?

As far as I'm aware, yes it is. But that's not to say there aren't any bugs.

@LiHaoGit
Copy link

I'm frustrated that this OpenAPI generation bug (missing type refs for multiple collections) persists in ASP.NET Core 9.0.4, despite prior expectations of a fix. This, plus other OpenAPI issues I've hit, makes it clear that the current state isn't production-ready for us.

When can we expect a definitive fix for this collection bug, and are there broader plans to stabilize OpenAPI generation in .NET 9? These recurring delays are significantly impacting our projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-openapi
Projects
None yet
Development

No branches or pull requests

3 participants