Skip to content

The ASP.NET Core package answers 500 for the OpenAPI document on Microsoft.AspNetCore.OpenApi 11: OpenApiResponse.Content changed its type #286

Backlog

Description

@CaffeinatedCoder

Package

CodoMetis.TypeKit.AspNetCore

Version

2.3.1 from nuget.org.

How does it fail?

Loudly, but only when the document is requested. Restore and build are clean: the package asks for Microsoft.AspNetCore.OpenApi 10.0.12 or later with no ceiling, so NuGet takes 11.0.0 (and Microsoft.OpenApi 3.11.0) without a warning. The endpoints themselves keep working.

What you ran

A net11.0 host, measured 2026-11-28. The value objects are in a domain project that has the generators; the host has none:

<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="11.0.0" />
<PackageReference Include="CodoMetis.TypeKit" Version="2.3.1" />
<PackageReference Include="CodoMetis.TypeKit.AspNetCore" Version="2.3.1" />
builder.Services.AddOpenApi(options => options.AddTypeKit());
app.MapOpenApi();
app.MapGet("/orders/{id}", (OrderId id, Quantity? minimum) => new Order(id, ...));
app.MapPost("/orders", (Order order) => order);

GET /openapi/v1.json.

What you got

500, with this in the log:

System.MissingMethodException: Method not found: 'Void Microsoft.OpenApi.OpenApiResponse.set_Content(
    System.Collections.Generic.IDictionary`2<System.String, Microsoft.OpenApi.OpenApiMediaType>)'.
   at CodoMetis.TypeKit.AspNetCore.FaultResponsesOperationTransformer.TransformAsync(OpenApiOperation operation, OpenApiOperationTransformerContext context, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.OpenApi.OpenApiDocumentService.GetOperationsAsync(...)

The same host without AddTypeKit() answers 200. GET /orders/{id} answers 200 in both, with each value object as its wrapped type.

What you expected

Either the document, or a restore that says the package can't sit beside Microsoft.AspNetCore.OpenApi 11.

Who it reaches

Every ASP.NET Core 11 host that has this package and takes Microsoft.AspNetCore.OpenApi 11, generally available since 2026-11-10. A host that writes its document at build time fails its build; one that serves it fails the first request for it.

What it means for 2.4.0

  • net11.0: OpenAPI transformers under OpenAPI 3.2, server-sent events and union return types #214's check 4 expects the transformer API to compile unchanged against Microsoft.OpenApi 3.x, or else a code path of its own for the net11.0 asset. This is the measured answer for the binary: it does not bind. Whether the source compiles is still to measure, and only the fault-responses transformer was reached here; the schema transformers were not.
  • The fix sits behind decision 129 as things stand: 2.4.0 is tagged on a stable Metalama 2027.0, and this package has no Metalama dependency.

To decide

The same three ways as for the EF Core package (#285): 2.4.0 only, a 2.3.2 that binds on both lines, or a 2.3.2 that declares the ceiling [10.0.12, 11.0.0).

Environment

macOS arm64, .NET SDK 11.0.100 (10.0.404 beside it), runtime 11.0.0, Microsoft.AspNetCore.OpenApi 11.0.0, Microsoft.OpenApi 3.11.0.

Activity

  1. added this to the 2.4.0 milestone on Nov 28, 2026
  2. added
    bug
    severity/high
    package/aspnetcore
    area/release
    on Nov 28, 2026
  3. CaffeinatedCoder commented on Nov 28, 2026

    @CaffeinatedCoder
    OwnerAuthor

    State 2026-11-28. Fixed on the net11.0 asset. Local branch build/metalama-2027-preview (from release/2.4.0, with #282 merged in), not pushed on 2026-11-28.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/releasebugpackage/aspnetcoreseverity/high

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions