Skip to content

[OpenApi] SourceGen on preview version: Property or indexer 'IOpenApiParameter.Example' cannot be assigned to #61885

Closed
@erwinkramer

Description

@erwinkramer

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I'm getting the following errors during build:

Property or indexer 'IOpenApiParameter.Example' cannot be assigned to -- it is read only [c:\Users\...\bank-api\BankApi.Service.Beta\BankApi.Service.Beta.csproj]
Property or indexer 'IOpenApiParameter.Deprecated' cannot be assigned to -- it is read only [c:\Users\...\bank-api\BankApi.Service.Beta\BankApi.Service.Beta.csproj]

Using:

    <PackageReference Include="Microsoft.OpenApi" Version="2.0.0-preview.17" />

Expected Behavior

Should build

Steps To Reproduce

Please use the branch related to erwinkramer/bank-api#6

Exceptions (if any)

Full ref:

[{
	"resource": "/c:/Users/../bank-api/BankApi.Service.Beta/obj/Debug/net10.0/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs",
	"owner": "csharp-build",
	"code": "CS0200",
	"severity": 8,
	"message": "Property or indexer 'IOpenApiParameter.Example' cannot be assigned to -- it is read only [c:\\Users\\..\\bank-api\\BankApi.Service.Beta\\BankApi.Service.Beta.csproj]",
	"startLineNumber": 249,
	"startColumn": 33,
	"endLineNumber": 249,
	"endColumn": 33
},{
	"resource": "/c:/Users/../bank-api/BankApi.Service.Beta/obj/Debug/net10.0/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs",
	"owner": "csharp-build",
	"code": "CS0200",
	"severity": 8,
	"message": "Property or indexer 'IOpenApiParameter.Deprecated' cannot be assigned to -- it is read only [c:\\Users\\..\\bank-api\\BankApi.Service.Beta\\BankApi.Service.Beta.csproj]",
	"startLineNumber": 251,
	"startColumn": 29,
	"endLineNumber": 251,
	"endColumn": 29
}]

.NET Version

10.0.100-preview.3.25201.16

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Status: Resolvedarea-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-openapi

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions