Skip to content

[Bug]: http-server-csharp: Some generated classes have wrong name, include _2 #11493

Description

@abatishchev

Describe the bug

The generated Operations controller has a wrong class name: it includes _2 and doesn't match the ctor.

Some examples:

public partial class ErrorResponse_2 : HttpServiceException
{
    public ErrorResponse(ErrorDetail error = default)
    {
        // ...
    }

and

public partial class OperationsController_2 : ControllerBase
{
    public OperationsController(IOperations_2 operations)
    {
         // ..
    }
}

Also:

public interface IOperations_2
{
}

Reproduction

  1. Use an ARM RP typespec
  2. Add the following to tspconfig.yaml
emit:
  - "@typespec/http-server-csharp"
options:
  "@typespec/http-server-csharp":
    emitter-output-dir: "{project-root}/generated/{emitter-name}"
    output-type: all

Checklist

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions