In my project I'm generating typescript clients via NSwagStudio.
To add credentails I have a BaseClient class that implements transformOptions
.
export class MyClient extends BaseClient{...
Now I need to add following lines at the beginning of each generated script:
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck
import { BaseClient } from 'my-components-lib';
Can this be done via NSwagStudio-Configuration and if, how?
For the
openApiToTypeScriptClient
code generator you can configure the settingextensionCode
setting to use an external template.Here's how I use it
And this is what my nswag.imports.ts file looks like
The final NSwag generated code looks something like this