From ac85c8f901f921f8ee6f4b294bc4e16d1e17f066 Mon Sep 17 00:00:00 2001 From: Gustaf Barkeling Date: Sat, 10 Aug 2019 09:45:41 +0100 Subject: [PATCH] Fix #3604 by adding undefined as return type to headers and credentials methods in runtime.ts (#3605) --- .../src/main/resources/typescript-fetch/runtime.mustache | 4 ++-- .../petstore/typescript-fetch/builds/default/src/runtime.ts | 4 ++-- .../typescript-fetch/builds/es6-target/src/runtime.ts | 4 ++-- .../builds/multiple-parameters/src/runtime.ts | 4 ++-- .../typescript-fetch/builds/with-interfaces/src/runtime.ts | 4 ++-- .../typescript-fetch/builds/with-npm-version/src/runtime.ts | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache index 942f65369c8..0b42e5e8629 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache @@ -171,11 +171,11 @@ export class Configuration { return undefined; } - get headers(): HTTPHeaders { + get headers(): HTTPHeaders | undefined { return this.configuration.headers; } - get credentials(): RequestCredentials { + get credentials(): RequestCredentials | undefined { return this.configuration.credentials; } } diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/default/src/runtime.ts index 48e54ca6eb2..eec2074ab69 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/src/runtime.ts @@ -182,11 +182,11 @@ export class Configuration { return undefined; } - get headers(): HTTPHeaders { + get headers(): HTTPHeaders | undefined { return this.configuration.headers; } - get credentials(): RequestCredentials { + get credentials(): RequestCredentials | undefined { return this.configuration.credentials; } } diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts index 48e54ca6eb2..eec2074ab69 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts @@ -182,11 +182,11 @@ export class Configuration { return undefined; } - get headers(): HTTPHeaders { + get headers(): HTTPHeaders | undefined { return this.configuration.headers; } - get credentials(): RequestCredentials { + get credentials(): RequestCredentials | undefined { return this.configuration.credentials; } } diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/runtime.ts index 48e54ca6eb2..eec2074ab69 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/runtime.ts @@ -182,11 +182,11 @@ export class Configuration { return undefined; } - get headers(): HTTPHeaders { + get headers(): HTTPHeaders | undefined { return this.configuration.headers; } - get credentials(): RequestCredentials { + get credentials(): RequestCredentials | undefined { return this.configuration.credentials; } } diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/runtime.ts index 48e54ca6eb2..eec2074ab69 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/runtime.ts @@ -182,11 +182,11 @@ export class Configuration { return undefined; } - get headers(): HTTPHeaders { + get headers(): HTTPHeaders | undefined { return this.configuration.headers; } - get credentials(): RequestCredentials { + get credentials(): RequestCredentials | undefined { return this.configuration.credentials; } } diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts index 48e54ca6eb2..eec2074ab69 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts @@ -182,11 +182,11 @@ export class Configuration { return undefined; } - get headers(): HTTPHeaders { + get headers(): HTTPHeaders | undefined { return this.configuration.headers; } - get credentials(): RequestCredentials { + get credentials(): RequestCredentials | undefined { return this.configuration.credentials; } }