Skip to content

[Bug]: http-server-csharp: Some generated model files have a generic, numbered name #11448

Description

Describe the bug

Supposedly, this model represents something like an operation result:

// Generated by @typespec/http-server-csharp
// <auto-generated />
#nullable enable

using System;
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
using TypeSpec.Helpers;
using TypeSpec.Helpers.JsonConverters;

namespace Microsoft.MyRpNamespace;

public partial class Model10
{
    /// <summary>
    /// The Location header contains the URL where the status of the long running operation can be checked.
    /// </summary>
    [JsonPropertyName("location")]
    public string Location { get; set; }

    /// <summary>
    /// The Retry-After header can indicate how long the client should wait before polling the operation status.
    /// </summary>
    [JsonPropertyName("retryAfter")]
    public int? RetryAfter { get; set; }
}

But:

  • File name: Model13.cs
  • Class name: Model13

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
    emit-mocks: none
    overwrite: true

Checklist

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions