diff --git a/modules/openapi-generator/src/main/resources/typescript-rxjs/apis.mustache b/modules/openapi-generator/src/main/resources/typescript-rxjs/apis.mustache index 0c70dc5e6ca9..3c548d7b547d 100644 --- a/modules/openapi-generator/src/main/resources/typescript-rxjs/apis.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-rxjs/apis.mustache @@ -86,7 +86,7 @@ export class {{classname}} extends BaseAPI { {{/hasHttpHeaders}} {{#hasQueryParams}} - const query: HttpQuery = { + const query: HttpQuery = { {{#queryParams}} {{#isListContainer}} {{#isCollectionFormatMulti}} diff --git a/modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache b/modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache index 555ee5aad668..7c58be70a52b 100644 --- a/modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache @@ -140,7 +140,7 @@ export const COLLECTION_FORMATS = { export type Json = any; export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; export type HttpHeaders = { [key: string]: string }; -export type HttpQuery = { [key: string]: string | number | null | boolean | Array }; +export type HttpQuery = Partial<{ [key: string]: string | number | null | boolean | Array }>; // partial is needed for strict mode export type HttpBody = Json | FormData; export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; diff --git a/samples/client/petstore/typescript-rxjs/builds/default/apis/PetApi.ts b/samples/client/petstore/typescript-rxjs/builds/default/apis/PetApi.ts index 16c0d116369e..a5328a8c7285 100644 --- a/samples/client/petstore/typescript-rxjs/builds/default/apis/PetApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/default/apis/PetApi.ts @@ -123,7 +123,7 @@ export class PetApi extends BaseAPI { }), }; - const query: HttpQuery = { + const query: HttpQuery = { ...(requestParameters.status && { 'status': requestParameters.status.join(COLLECTION_FORMATS['csv']) }), }; @@ -151,7 +151,7 @@ export class PetApi extends BaseAPI { }), }; - const query: HttpQuery = { + const query: HttpQuery = { ...(requestParameters.tags && { 'tags': requestParameters.tags.join(COLLECTION_FORMATS['csv']) }), }; diff --git a/samples/client/petstore/typescript-rxjs/builds/default/apis/UserApi.ts b/samples/client/petstore/typescript-rxjs/builds/default/apis/UserApi.ts index ed3aaa8e371a..2194fdfe9f68 100644 --- a/samples/client/petstore/typescript-rxjs/builds/default/apis/UserApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/default/apis/UserApi.ts @@ -139,7 +139,7 @@ export class UserApi extends BaseAPI { throwIfRequired(requestParameters, 'username', 'loginUser'); throwIfRequired(requestParameters, 'password', 'loginUser'); - const query: HttpQuery = { + const query: HttpQuery = { ...(requestParameters.username && { 'username': requestParameters.username }), ...(requestParameters.password && { 'password': requestParameters.password }), }; diff --git a/samples/client/petstore/typescript-rxjs/builds/default/runtime.ts b/samples/client/petstore/typescript-rxjs/builds/default/runtime.ts index 1bbd8633b299..e71a012b04bd 100644 --- a/samples/client/petstore/typescript-rxjs/builds/default/runtime.ts +++ b/samples/client/petstore/typescript-rxjs/builds/default/runtime.ts @@ -151,7 +151,7 @@ export const COLLECTION_FORMATS = { export type Json = any; export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; export type HttpHeaders = { [key: string]: string }; -export type HttpQuery = { [key: string]: string | number | null | boolean | Array }; +export type HttpQuery = Partial<{ [key: string]: string | number | null | boolean | Array }>; // partial is needed for strict mode export type HttpBody = Json | FormData; export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/PetApi.ts b/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/PetApi.ts index 16c0d116369e..a5328a8c7285 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/PetApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/PetApi.ts @@ -123,7 +123,7 @@ export class PetApi extends BaseAPI { }), }; - const query: HttpQuery = { + const query: HttpQuery = { ...(requestParameters.status && { 'status': requestParameters.status.join(COLLECTION_FORMATS['csv']) }), }; @@ -151,7 +151,7 @@ export class PetApi extends BaseAPI { }), }; - const query: HttpQuery = { + const query: HttpQuery = { ...(requestParameters.tags && { 'tags': requestParameters.tags.join(COLLECTION_FORMATS['csv']) }), }; diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/UserApi.ts b/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/UserApi.ts index ed3aaa8e371a..2194fdfe9f68 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/UserApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/UserApi.ts @@ -139,7 +139,7 @@ export class UserApi extends BaseAPI { throwIfRequired(requestParameters, 'username', 'loginUser'); throwIfRequired(requestParameters, 'password', 'loginUser'); - const query: HttpQuery = { + const query: HttpQuery = { ...(requestParameters.username && { 'username': requestParameters.username }), ...(requestParameters.password && { 'password': requestParameters.password }), }; diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/runtime.ts b/samples/client/petstore/typescript-rxjs/builds/es6-target/runtime.ts index 1bbd8633b299..e71a012b04bd 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/runtime.ts +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/runtime.ts @@ -151,7 +151,7 @@ export const COLLECTION_FORMATS = { export type Json = any; export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; export type HttpHeaders = { [key: string]: string }; -export type HttpQuery = { [key: string]: string | number | null | boolean | Array }; +export type HttpQuery = Partial<{ [key: string]: string | number | null | boolean | Array }>; // partial is needed for strict mode export type HttpBody = Json | FormData; export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; diff --git a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/PetApi.ts b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/PetApi.ts index 16c0d116369e..a5328a8c7285 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/PetApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/PetApi.ts @@ -123,7 +123,7 @@ export class PetApi extends BaseAPI { }), }; - const query: HttpQuery = { + const query: HttpQuery = { ...(requestParameters.status && { 'status': requestParameters.status.join(COLLECTION_FORMATS['csv']) }), }; @@ -151,7 +151,7 @@ export class PetApi extends BaseAPI { }), }; - const query: HttpQuery = { + const query: HttpQuery = { ...(requestParameters.tags && { 'tags': requestParameters.tags.join(COLLECTION_FORMATS['csv']) }), }; diff --git a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/UserApi.ts b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/UserApi.ts index ed3aaa8e371a..2194fdfe9f68 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/UserApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/UserApi.ts @@ -139,7 +139,7 @@ export class UserApi extends BaseAPI { throwIfRequired(requestParameters, 'username', 'loginUser'); throwIfRequired(requestParameters, 'password', 'loginUser'); - const query: HttpQuery = { + const query: HttpQuery = { ...(requestParameters.username && { 'username': requestParameters.username }), ...(requestParameters.password && { 'password': requestParameters.password }), }; diff --git a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/runtime.ts b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/runtime.ts index 1bbd8633b299..e71a012b04bd 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/runtime.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/runtime.ts @@ -151,7 +151,7 @@ export const COLLECTION_FORMATS = { export type Json = any; export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; export type HttpHeaders = { [key: string]: string }; -export type HttpQuery = { [key: string]: string | number | null | boolean | Array }; +export type HttpQuery = Partial<{ [key: string]: string | number | null | boolean | Array }>; // partial is needed for strict mode export type HttpBody = Json | FormData; export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/PetApi.ts b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/PetApi.ts index 16c0d116369e..a5328a8c7285 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/PetApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/PetApi.ts @@ -123,7 +123,7 @@ export class PetApi extends BaseAPI { }), }; - const query: HttpQuery = { + const query: HttpQuery = { ...(requestParameters.status && { 'status': requestParameters.status.join(COLLECTION_FORMATS['csv']) }), }; @@ -151,7 +151,7 @@ export class PetApi extends BaseAPI { }), }; - const query: HttpQuery = { + const query: HttpQuery = { ...(requestParameters.tags && { 'tags': requestParameters.tags.join(COLLECTION_FORMATS['csv']) }), }; diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/UserApi.ts b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/UserApi.ts index ed3aaa8e371a..2194fdfe9f68 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/UserApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/UserApi.ts @@ -139,7 +139,7 @@ export class UserApi extends BaseAPI { throwIfRequired(requestParameters, 'username', 'loginUser'); throwIfRequired(requestParameters, 'password', 'loginUser'); - const query: HttpQuery = { + const query: HttpQuery = { ...(requestParameters.username && { 'username': requestParameters.username }), ...(requestParameters.password && { 'password': requestParameters.password }), }; diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/runtime.ts b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/runtime.ts index 1bbd8633b299..e71a012b04bd 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/runtime.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/runtime.ts @@ -151,7 +151,7 @@ export const COLLECTION_FORMATS = { export type Json = any; export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; export type HttpHeaders = { [key: string]: string }; -export type HttpQuery = { [key: string]: string | number | null | boolean | Array }; +export type HttpQuery = Partial<{ [key: string]: string | number | null | boolean | Array }>; // partial is needed for strict mode export type HttpBody = Json | FormData; export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original';