diff --git a/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/api.mustache b/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/api.mustache index ab0b3c8523b..5bf0ed7fb92 100644 --- a/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/api.mustache +++ b/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/api.mustache @@ -10,7 +10,7 @@ import * as assign from "core-js/library/fn/object/assign"; interface Dictionary { [index: string]: T; } export interface FetchAPI { (url: string, init?: any): Promise; } -const BASE_PATH = "{{basePath}}"; +const BASE_PATH = "{{{basePath}}}".replace(/\/+$/, ''); export interface FetchArgs { url: string; diff --git a/samples/client/petstore/typescript-fetch/builds/default/api.ts b/samples/client/petstore/typescript-fetch/builds/default/api.ts index 7fb386b373e..a83e38286ac 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/api.ts @@ -31,7 +31,7 @@ import * as assign from "core-js/library/fn/object/assign"; interface Dictionary { [index: string]: T; } export interface FetchAPI { (url: string, init?: any): Promise; } -const BASE_PATH = "http://petstore.swagger.io/v2"; +const BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, ''); export interface FetchArgs { url: string; diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts index d27ef74f82e..bf3b7c9bab2 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts @@ -30,7 +30,7 @@ import * as isomorphicFetch from "isomorphic-fetch"; interface Dictionary { [index: string]: T; } export interface FetchAPI { (url: string, init?: any): Promise; } -const BASE_PATH = "http://petstore.swagger.io/v2"; +const BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, ''); export interface FetchArgs { url: string; diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts index 7fb386b373e..a83e38286ac 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts @@ -31,7 +31,7 @@ import * as assign from "core-js/library/fn/object/assign"; interface Dictionary { [index: string]: T; } export interface FetchAPI { (url: string, init?: any): Promise; } -const BASE_PATH = "http://petstore.swagger.io/v2"; +const BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, ''); export interface FetchArgs { url: string;