You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Swagger Codegen produces incorrect output for typescript-angular for get methods that receive multiple query parameters (?a=1&b=2). But produces the correct output for get methods that receive path parameters (/{a}/{b} /1/2 )
/** * getDocumentTypes * * @param documentContext documentContext * @param lifecycleStage lifecycleStage * @param processType processType * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */publicgetDocumentTypesUsingGET(documentContext?: string,lifecycleStage?: string,processType?: string,observe?: 'body',reportProgress?: boolean): Observable<ResponseGenericListDocumentSubType>;publicgetDocumentTypesUsingGET(documentContext?: string,lifecycleStage?: string,processType?: string,observe?: 'response',reportProgress?: boolean): Observable<HttpResponse<ResponseGenericListDocumentSubType>>;publicgetDocumentTypesUsingGET(documentContext?: string,lifecycleStage?: string,processType?: string,observe?: 'events',reportProgress?: boolean): Observable<HttpEvent<ResponseGenericListDocumentSubType>>;publicgetDocumentTypesUsingGET(documentContext?: string,lifecycleStage?: string,processType?: string,observe: any='body',reportProgress: boolean=false): Observable<any>{let queryParameters =newHttpParams({encoder: newCustomHttpUrlEncodingCodec()});if(documentContext!==undefined&&documentContext!==null){queryParameters=queryParameters.set('documentContext',<any>documentContext);}if(lifecycleStage!==undefined&&lifecycleStage!==null){queryParameters=queryParameters.set('lifecycleStage',<any>lifecycleStage);}if(processType!==undefined&&processType!==null){queryParameters=queryParameters.set('processType',<any>processType);}letheaders=this.defaultHeaders;// to determine the Accept headerlethttpHeaderAccepts: string[]=['*/*'];consthttpHeaderAcceptSelected: string|undefined=this.configuration.selectHeaderAccept(httpHeaderAccepts);if(httpHeaderAcceptSelected!=undefined){headers=headers.set('Accept',httpHeaderAcceptSelected);}// to determine the Content-Type headerconstconsumes: string[]=['application/json'];// ERROR ON THIS LINEreturnthis.httpClient.get<ResponseGenericListDocumentSubType>(`${this.basePath}/adr/refData/documentTypes${encodeURIComponent(String(documentContextlifecycleStageprocessType))}`,{params: queryParameters,withCredentials: this.configuration.withCredentials,headers: headers,observe: observe,reportProgress: reportProgress});}
The url query parameters are incorrectly appended and encoded at the end of the url path
Description
Swagger Codegen produces incorrect output for typescript-angular for
get
methods that receive multiple query parameters (?a=1&b=2
). But produces the correct output forget
methods that receive path parameters (/{a}/{b} /1/2
)The
url query parameters
are incorrectly appended and encoded at the end of the url pathSwagger-codegen version
swagger-codegen-cli-2.3.1
Swagger declaration file content or url
Command line used for generation
java -jar tools/swagger-codegen-cli-2.3.1.jar generate -i http://localhost:8082/ngs/swagger.json -l typescript-angular -t tools/templates -o src/app/api -c swagger-codegen.config.json
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement
I would guess the error resides somewhere in since the
{{{path}}}
is output as in Mustache templateshttps://github.com/swagger-api/swagger-codegen/blob/v2.3.1/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngularClientCodegen.java
The text was updated successfully, but these errors were encountered: