Skip to content

TypeSpec C# emitter doesn't produce LRO method with return type of non-generic Azure.Operation #3965

@devlie

Description

@devlie

We are converting our Swagger to TypeSpec, and we have 2 LRO APIs, ImportDevices and ImportUpdate. The newly generated code changes the return type from Operation to Operation<BinaryData> so compilation breaks as it detects breaking change.

In generated client, I only see this which returns generic Operation:

public virtual Operation ImportDevices(WaitUntil waitUntil, RequestContent content, RequestContext context = null)

dotnet pack would return error:

C:\Users\leolie\.nuget\packages\microsoft.dotnet.apicompat\5.0.0-beta.20467.1\build\Microsoft.DotNet.ApiCompat.targets(82,5): error : MembersMustExist : Member 'public Azure.Operation Azure.IoT.DeviceUpdate.DeviceManagementClient.ImportDevices(Azure.WaitUntil, Azure.Core.RequestContent, Azure.RequestContext)' does
not exist in the implementation but it does exist in the contract. [D:\repos\azure-sdk-for-net\sdk\deviceupdate\Azure.IoT.DeviceUpdate\src\Azure.IoT.DeviceUpdate.csproj::TargetFramework=netstandard2.0] 

There is no way for me to workaround this as I cannot just hand-implement the old method since the method name and signature are identical except the return type.

Metadata

Metadata

Assignees

Labels

DPGDPG/RLC v2.1Post Gallium workGA-Requiredcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-author-feedbackWorkflow: More information is needed from author to address the issue.no-recent-activityThere has been no recent activity on this issue.v3Version 3 of AutoRest C# generator.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions