Skip to content

TypeScriptClientGeneratorSettings

Rico Suter edited this page Jun 10, 2019 · 10 revisions

Inherits ClientGeneratorBaseSettings

Properties:

  • TypeScriptGeneratorSettings: The TypeScript DTO interface/class generator settings (implemented in NJsonSchema)
  • ClassName: The client class name. If multiple classes are generated, the placeholder {controller} is replaced with the name of the controller.
  • Template: More information...
    • JQueryCallbacks: The generated client class uses callbacks and JQuery for HTTP calls
    • JQueryPromises: The generated client class uses the promises (Q or ES polyfilled) and JQuery for HTTP calls
    • AngularJS: The generated client class uses the $http service from AngularJS
    • Angular: The generated client class uses the http service from Angular 2
    • Fetch: Uses the window.fetch API and ES6 promises
    • Aurelia: Uses the fetch client of aurelia
  • PromiseType: The promise type (Promise | QPromise), can only be changed for the JQuery templates
  • WrapDtoExceptions: Specifies whether DTO exceptions are wrapped in a SwaggerError instance or thrown directly (default: false).
  • ClientBaseClass
  • ConfigurationClass
  • UseTransformOptionsMethod
  • UseTransformResultMethod
  • ProtectedMethods: Methods which are generated with the protected keyword (usually used to provide an own implementation and call the protected in it)
  • ImportRequiredTypes: (default: true)
  • UseGetBaseUrlMethod: (must be implemented in the base class or extension code)
    • Implement a method getBaseUrl(defaultUrl: string, requestedUrl?: string) { return requestedUrl ? requestedUrl : defaultUrl; }
  • QueryNullValue
  • ExceptionClass

Angular template only:

  • BaseUrlTokenName
  • HttpClass
  • RxJsVersion
  • UseSingletonProvider
  • InjectionTokenType

For more properties: TypeScriptClientGeneratorSettings.cs