From 897a61b4cdf3884f02ff4ff67e2daca1ba288e01 Mon Sep 17 00:00:00 2001 From: Asad Saeeduddin Date: Sat, 18 Nov 2017 20:09:54 -0500 Subject: [PATCH 1/3] Commit leftover snapshot changes --- .../typescript-fetch/builds/default/api.ts | 24 +++++++++---------- .../builds/default/git_push.sh | 2 +- .../typescript-fetch/builds/es6-target/api.ts | 24 +++++++++---------- .../builds/es6-target/git_push.sh | 2 +- .../builds/with-npm-version/api.ts | 24 +++++++++---------- .../builds/with-npm-version/git_push.sh | 2 +- 6 files changed, 39 insertions(+), 39 deletions(-) diff --git a/samples/client/petstore/typescript-fetch/builds/default/api.ts b/samples/client/petstore/typescript-fetch/builds/default/api.ts index 524623e31c8..6cc673e543c 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/api.ts @@ -36,7 +36,7 @@ export const COLLECTION_FORMATS = { * @interface FetchAPI */ export interface FetchAPI { - (url: string, init?: any): Promise; + (url: string, init?: any): Promise; } /** @@ -689,7 +689,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - addPet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + addPet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = PetApiFetchParamCreator(configuration).addPet(body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -709,7 +709,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deletePet(petId: number, apiKey?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + deletePet(petId: number, apiKey?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = PetApiFetchParamCreator(configuration).deletePet(petId, apiKey, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -785,7 +785,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + updatePet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = PetApiFetchParamCreator(configuration).updatePet(body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -806,7 +806,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = PetApiFetchParamCreator(configuration).updatePetWithForm(petId, name, status, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1188,7 +1188,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteOrder(orderId: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + deleteOrder(orderId: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = StoreApiFetchParamCreator(configuration).deleteOrder(orderId, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1637,7 +1637,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUser(body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + createUser(body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUser(body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1656,7 +1656,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithArrayInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + createUsersWithArrayInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUsersWithArrayInput(body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1675,7 +1675,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithListInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + createUsersWithListInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUsersWithListInput(body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1694,7 +1694,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteUser(username: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + deleteUser(username: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).deleteUser(username, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1751,7 +1751,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - logoutUser(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + logoutUser(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).logoutUser(options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1771,7 +1771,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateUser(username: string, body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + updateUser(username: string, body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).updateUser(username, body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { diff --git a/samples/client/petstore/typescript-fetch/builds/default/git_push.sh b/samples/client/petstore/typescript-fetch/builds/default/git_push.sh index 1eb5727f6cd..a1ff4c9bcba 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/git_push.sh +++ b/samples/client/petstore/typescript-fetch/builds/default/git_push.sh @@ -36,7 +36,7 @@ git_remote=`git remote` if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment." + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git 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 524623e31c8..6cc673e543c 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts @@ -36,7 +36,7 @@ export const COLLECTION_FORMATS = { * @interface FetchAPI */ export interface FetchAPI { - (url: string, init?: any): Promise; + (url: string, init?: any): Promise; } /** @@ -689,7 +689,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - addPet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + addPet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = PetApiFetchParamCreator(configuration).addPet(body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -709,7 +709,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deletePet(petId: number, apiKey?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + deletePet(petId: number, apiKey?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = PetApiFetchParamCreator(configuration).deletePet(petId, apiKey, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -785,7 +785,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + updatePet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = PetApiFetchParamCreator(configuration).updatePet(body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -806,7 +806,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = PetApiFetchParamCreator(configuration).updatePetWithForm(petId, name, status, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1188,7 +1188,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteOrder(orderId: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + deleteOrder(orderId: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = StoreApiFetchParamCreator(configuration).deleteOrder(orderId, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1637,7 +1637,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUser(body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + createUser(body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUser(body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1656,7 +1656,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithArrayInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + createUsersWithArrayInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUsersWithArrayInput(body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1675,7 +1675,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithListInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + createUsersWithListInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUsersWithListInput(body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1694,7 +1694,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteUser(username: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + deleteUser(username: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).deleteUser(username, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1751,7 +1751,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - logoutUser(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + logoutUser(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).logoutUser(options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1771,7 +1771,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateUser(username: string, body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + updateUser(username: string, body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).updateUser(username, body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/git_push.sh b/samples/client/petstore/typescript-fetch/builds/es6-target/git_push.sh index 1eb5727f6cd..a1ff4c9bcba 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/git_push.sh +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/git_push.sh @@ -36,7 +36,7 @@ git_remote=`git remote` if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment." + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git 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 524623e31c8..6cc673e543c 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 @@ -36,7 +36,7 @@ export const COLLECTION_FORMATS = { * @interface FetchAPI */ export interface FetchAPI { - (url: string, init?: any): Promise; + (url: string, init?: any): Promise; } /** @@ -689,7 +689,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - addPet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + addPet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = PetApiFetchParamCreator(configuration).addPet(body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -709,7 +709,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deletePet(petId: number, apiKey?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + deletePet(petId: number, apiKey?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = PetApiFetchParamCreator(configuration).deletePet(petId, apiKey, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -785,7 +785,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + updatePet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = PetApiFetchParamCreator(configuration).updatePet(body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -806,7 +806,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = PetApiFetchParamCreator(configuration).updatePetWithForm(petId, name, status, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1188,7 +1188,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteOrder(orderId: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + deleteOrder(orderId: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = StoreApiFetchParamCreator(configuration).deleteOrder(orderId, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1637,7 +1637,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUser(body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + createUser(body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUser(body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1656,7 +1656,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithArrayInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + createUsersWithArrayInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUsersWithArrayInput(body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1675,7 +1675,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithListInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + createUsersWithListInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUsersWithListInput(body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1694,7 +1694,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteUser(username: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + deleteUser(username: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).deleteUser(username, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1751,7 +1751,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - logoutUser(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + logoutUser(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).logoutUser(options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1771,7 +1771,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateUser(username: string, body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + updateUser(username: string, body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).updateUser(username, body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/git_push.sh b/samples/client/petstore/typescript-fetch/builds/with-npm-version/git_push.sh index 1eb5727f6cd..a1ff4c9bcba 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/git_push.sh +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/git_push.sh @@ -36,7 +36,7 @@ git_remote=`git remote` if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment." + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git From f83c76836031927190a5ce087c4a920a996b8ebd Mon Sep 17 00:00:00 2001 From: Asad Saeeduddin Date: Sat, 18 Nov 2017 19:37:09 -0500 Subject: [PATCH 2/3] Add logic to deal with non-JSON body params If the spec specifies a list of consumes MIME types, default to the first MIME type in the list instead of "application/json" (the user may still override this by passing "Content-Type" in options.headers). Additionally, only perform explicit JSON serialization if the data type of the body parameter is not "string", or if it is string, only when the content type is "application/json". --- .../src/main/resources/typescript-fetch/api.mustache | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 1745c5dcddf..476a1c767fd 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-fetch/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-fetch/api.mustache @@ -212,7 +212,12 @@ export const {{classname}}FetchParamCreator = function (configuration?: Configur {{/hasFormParams}} {{#bodyParam}} + {{^consumes}} localVarHeaderParameter['Content-Type'] = 'application/json'; + {{/consumes}} + {{#consumes.0}} + localVarHeaderParameter['Content-Type'] = '{{mediaType}}'; + {{/consumes.0}} {{/bodyParam}} localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); @@ -223,7 +228,8 @@ export const {{classname}}FetchParamCreator = function (configuration?: Configur localVarRequestOptions.body = localVarFormParams.toString(); {{/hasFormParams}} {{#bodyParam}} - localVarRequestOptions.body = JSON.stringify({{paramName}} || {}); + const needsSerialization = ("{{dataType}}" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify({{paramName}} || {}) : ({{paramName}} || ""); {{/bodyParam}} return { From 598e90b957a80cf7eedb2725647bb8c40a69845d Mon Sep 17 00:00:00 2001 From: Asad Saeeduddin Date: Sat, 18 Nov 2017 19:42:40 -0500 Subject: [PATCH 3/3] Update snapshots --- .../typescript-fetch/builds/default/api.ts | 21 ++++++++++++------- .../typescript-fetch/builds/es6-target/api.ts | 21 ++++++++++++------- .../builds/with-npm-version/api.ts | 21 ++++++++++++------- 3 files changed, 42 insertions(+), 21 deletions(-) diff --git a/samples/client/petstore/typescript-fetch/builds/default/api.ts b/samples/client/petstore/typescript-fetch/builds/default/api.ts index 6cc673e543c..74b5bd4f72e 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/api.ts @@ -360,7 +360,8 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - localVarRequestOptions.body = JSON.stringify(body || {}); + const needsSerialization = ("Pet" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); return { url: url.format(localVarUrlObj), @@ -562,7 +563,8 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - localVarRequestOptions.body = JSON.stringify(body || {}); + const needsSerialization = ("Pet" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); return { url: url.format(localVarUrlObj), @@ -1165,7 +1167,8 @@ export const StoreApiFetchParamCreator = function (configuration?: Configuration // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - localVarRequestOptions.body = JSON.stringify(body || {}); + const needsSerialization = ("Order" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); return { url: url.format(localVarUrlObj), @@ -1393,7 +1396,8 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - localVarRequestOptions.body = JSON.stringify(body || {}); + const needsSerialization = ("User" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); return { url: url.format(localVarUrlObj), @@ -1424,7 +1428,8 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - localVarRequestOptions.body = JSON.stringify(body || {}); + const needsSerialization = ("Array<User>" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); return { url: url.format(localVarUrlObj), @@ -1455,7 +1460,8 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - localVarRequestOptions.body = JSON.stringify(body || {}); + const needsSerialization = ("Array<User>" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); return { url: url.format(localVarUrlObj), @@ -1614,7 +1620,8 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - localVarRequestOptions.body = JSON.stringify(body || {}); + const needsSerialization = ("User" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); return { url: url.format(localVarUrlObj), 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 6cc673e543c..74b5bd4f72e 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts @@ -360,7 +360,8 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - localVarRequestOptions.body = JSON.stringify(body || {}); + const needsSerialization = ("Pet" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); return { url: url.format(localVarUrlObj), @@ -562,7 +563,8 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - localVarRequestOptions.body = JSON.stringify(body || {}); + const needsSerialization = ("Pet" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); return { url: url.format(localVarUrlObj), @@ -1165,7 +1167,8 @@ export const StoreApiFetchParamCreator = function (configuration?: Configuration // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - localVarRequestOptions.body = JSON.stringify(body || {}); + const needsSerialization = ("Order" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); return { url: url.format(localVarUrlObj), @@ -1393,7 +1396,8 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - localVarRequestOptions.body = JSON.stringify(body || {}); + const needsSerialization = ("User" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); return { url: url.format(localVarUrlObj), @@ -1424,7 +1428,8 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - localVarRequestOptions.body = JSON.stringify(body || {}); + const needsSerialization = ("Array<User>" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); return { url: url.format(localVarUrlObj), @@ -1455,7 +1460,8 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - localVarRequestOptions.body = JSON.stringify(body || {}); + const needsSerialization = ("Array<User>" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); return { url: url.format(localVarUrlObj), @@ -1614,7 +1620,8 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - localVarRequestOptions.body = JSON.stringify(body || {}); + const needsSerialization = ("User" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); return { url: url.format(localVarUrlObj), 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 6cc673e543c..74b5bd4f72e 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 @@ -360,7 +360,8 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - localVarRequestOptions.body = JSON.stringify(body || {}); + const needsSerialization = ("Pet" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); return { url: url.format(localVarUrlObj), @@ -562,7 +563,8 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - localVarRequestOptions.body = JSON.stringify(body || {}); + const needsSerialization = ("Pet" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); return { url: url.format(localVarUrlObj), @@ -1165,7 +1167,8 @@ export const StoreApiFetchParamCreator = function (configuration?: Configuration // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - localVarRequestOptions.body = JSON.stringify(body || {}); + const needsSerialization = ("Order" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); return { url: url.format(localVarUrlObj), @@ -1393,7 +1396,8 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - localVarRequestOptions.body = JSON.stringify(body || {}); + const needsSerialization = ("User" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); return { url: url.format(localVarUrlObj), @@ -1424,7 +1428,8 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - localVarRequestOptions.body = JSON.stringify(body || {}); + const needsSerialization = ("Array<User>" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); return { url: url.format(localVarUrlObj), @@ -1455,7 +1460,8 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - localVarRequestOptions.body = JSON.stringify(body || {}); + const needsSerialization = ("Array<User>" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); return { url: url.format(localVarUrlObj), @@ -1614,7 +1620,8 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - localVarRequestOptions.body = JSON.stringify(body || {}); + const needsSerialization = ("User" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); return { url: url.format(localVarUrlObj),