Skip to content

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

Open
@tijs-hendriks-mosadex

Description

@tijs-hendriks-mosadex

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesfeature-openapi

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions