Advertisement
kromm77

Untitled

Aug 28th, 2019
690
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. https://github.com/RicoSuter/NSwag/wiki/TypeScriptClientGenerator
  2.  
  3. aggiungere in nswag
  4.  
  5. extensionCode: "path.file.ts"
  6. clientBaseClass : "ServiceBase"
  7.  
  8.  
  9.  
  10. creo un file path.file.ts  ( non aggiungere import in test perchè viene solo copiato un testa a client.ts generato )
  11.  
  12. ```ts
  13. export class ServiceBase {
  14.  
  15.     protected transformResult(url: string, response: AxiosResponse, processor: (response: AxiosResponse) => Promise<any>): Promise<any> {
  16.         response.data=        response.data.result;
  17.         return processor(response);
  18.     }
  19. }
  20. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement