Skip to content

Using custom CADL operation template and getting unexpected response in DPG code #3041

@catalinaperalta

Description

@catalinaperalta

Describe the issue or request
The service team is using the following operation template:

@doc("Long running RPC operation template")
op LongRunningRpcOperation<
    TParams extends object,
    TResponse extends object
  > is RpcOperation<
    TParams,
    Foundations.AcceptedResponse<TResponse &
      Foundations.LongRunningStatusLocation>
  >;

This is causing the operation signature to come out as the operation returning an AcceptedResponse instead of the TResponse.

Current output:

public virtual async Task<Operation<AcceptedResponse>> InferOncologyPhenotypingAsync(WaitUntil waitUntil, OncoPhenotypeRequest oncoPhenotypeRequest, CancellationToken cancellationToken = default)

Describe your ideas for solutions

Expected output:

public virtual async Task<Operation<OncoPhenotypeResponse>> InferOncologyPhenotypingAsync(WaitUntil waitUntil, OncoPhenotypeRequest oncoPhenotypeRequest, CancellationToken cancellationToken = default)

Add labels
As appropriate, select a label to describe how hard the issue is to work
around or how hard it would be to do without a particular feature that
could help make it easier. These labels start with "workaround".

Also select a label that describes how many instances of the workaround
you would have to do without the bug being fixed or feature implemented.
These labels start with "instances".

These labels will help priority bug fixes and feature requests.

If this bug or feature request is for older versions of autorest, please
remove the v3 label and add the v2 label as appropriate.

Metadata

Metadata

Assignees

Labels

DPGDPG/RLC v2.0 GAbugThis issue requires a change to an existing behavior in the product in order to be resolved.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