microsoft / typespec

https://typespec.io/
MIT License
4.55k stars 221 forks source link

[http-server-csharp] literal type is not properly generated #5024

Open ArcturusZhang opened 2 weeks ago

ArcturusZhang commented 2 weeks ago

In the contoso project, we have this interface generated:

public interface IWidgets
{
    Task<WidgetSuite> CreateOrUpdateWidgetAsync(string apiVersion, string widgetName, "application/merge-patch+json" contentType, WidgetSuite resource);
}

It misuses a string value as the type of contentType which is incorrect. This might be indicating the generator is not properly handling the literal types.

markcowl commented 2 weeks ago