From 009dfaf46456910aadbd52025a9714918ab7bba3 Mon Sep 17 00:00:00 2001 From: Gustaf Barkeling Date: Fri, 9 Aug 2019 21:01:38 +0100 Subject: [PATCH] Fix #3604 by adding undefined as return type to headers and credentials methods in runtime.ts --- .../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 942f65369c88..0b42e5e8629a 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 48e54ca6eb21..eec2074ab690 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 48e54ca6eb21..eec2074ab690 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 48e54ca6eb21..eec2074ab690 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 48e54ca6eb21..eec2074ab690 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 48e54ca6eb21..eec2074ab690 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; } }