Is the configurations setting TypeScriptVersion valid in Nswag 14?

47 Views Asked by At

Is the TypeScriptVersion setting still in use for Nswag 14, or is there another way to specify which Typescript version to target?

I am trying to use NSwag 14 to generate Typescript for a Asp.Net service (in .Net 8) and while I in the configuration nswag.json file tried to specify TypeScriptVersion to 2.7, Nswag still generates version 3.7 TypeScript code. More specific, Nswag generates TS code that contains the ?? operator, that was introduced in TypeScript 3.7. (I'm not able to change TypeScript version for the target project in this case.)

It seems pretty easy to reproduce this, I set up a github repo that is able to do this based on the default WeatherForcast web service: https://github.com/Magnus-K-work/nswag_ts_generation

0

There are 0 best solutions below