Swagger Open API: Remove ReportProgress in Angular Typescript

爱⌒轻易说出口 提交于 2020-08-10 19:15:14

问题


We are using Swagger IO CodeGen, to create Angular API Service Proxies? Currently linking Net Core 3 APIs with Angular Typescript.

https://editor.swagger.io/

public addProduct(product?: string, observe?: 'body', reportProgress?: boolean): Observable<CreatePropertyResponse>;
public addProduct(product?: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<CreatePropertyResponse>>;
public addProduct(product?: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<CreatePropertyResponse>>;
public addProduct(product?: string, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {

Its currently creating 4 methods:

  1. Is there a way to remove reportProgress Or maybe even Observe as a paramter variable, we don't need that.
  2. Additionally, how to get proxy down to 1 method, instead of 4 override methods below?

Will accept javascript answer for CodeGen.

来源:https://stackoverflow.com/questions/63145112/swagger-open-api-remove-reportprogress-in-angular-typescript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!