Skip to content

Standard chinese text from Microsoft injected into generated Typescript code after 14.3.0 #5134

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
CRidge opened this issue Apr 2, 2025 · 3 comments

Comments

@CRidge
Copy link

CRidge commented Apr 2, 2025

Just a tiny annoyance, really:

We generate Typescript code from our API using NSwag, and one of our endpoints reference System.Net.HttpStatusCode, so we get generated code for this, as expected.

Since upgrading to 14.3.0, we see this:

Image

This is the standard description of that type from Microsoft, in Chinese.

We have no reference to Chinese localization in our setup, so I don't think the link to that language is in our code base.

As I said, not a big deal, but having comments in a language no one on our teams understands, just looks odd ;)

@lahma
Copy link
Collaborator

lahma commented Apr 2, 2025

My uneducated guess is that this might get routed to NuGet package folder where System.Net.Primitives 4.3.0 or similar gets chosen with odd language. So basically NuGet package contains the localizations that you are facing.

@lahma
Copy link
Collaborator

lahma commented Apr 6, 2025

Might be fixed by RicoSuter/Namotion.Reflection#169 , but unsure. Don't know the platform you are running on. You can also always turn of XML documentation based code documentation, it has also performance drawbacks if you don't actually use the documentation.

@jswanso
Copy link

jswanso commented May 28, 2025

We too are seeing this issue too and it is concerning. Our generated TypeScript code shows that new comment with the Chinese characters.

Below is the before and after auto-generated message. We use NSwag.AspNetCore and NSwag.MSBuild. The nswag.json file has the runtime set to "Net80".

Before:
Generated using the NSwag toolchain v14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)

After:
Generated using the NSwag toolchain v14.4.0.0 (NJsonSchema v11.3.2.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants