Skip to content

Property or indexer 'IOpenApiMediaType.Example' cannot be assigned to -- it is read only #64317

@jacobrillema

Description

@jacobrillema

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Latest dotnet SDK 10, running on macOS M1/ARM. Getting this build error.

net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(399,41): error CS0200: Property or indexer 'IOpenApiMediaType.Example' cannot be assigned to -- it is read only

Happened after I upgraded this morning. This is the error of code in the generated file

foreach (var mediaType in content)
{
mediaType.Example = jsonString.Parse();
}

Expected Behavior

No response

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-openapi

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions