From 338942c59c297445ed1fc58a68fde58308d2d642 Mon Sep 17 00:00:00 2001 From: Vladimir Jimenez Date: Thu, 19 Sep 2019 18:48:18 -0700 Subject: [PATCH 1/3] [typescript][fetch] fix null typing errors --- .../resources/typescript-fetch/apis.mustache | 16 ++++++++-------- .../typescript-fetch/modelGeneric.mustache | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache index 75568642d938..57da60ee261c 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache @@ -229,14 +229,14 @@ export class {{classname}} extends runtime.BaseAPI { {{/returnType}} } - /** - {{#notes}} - * {{¬es}} - {{/notes}} - {{#summary}} - * {{&summary}} - {{/summary}} - */ + /** + {{#notes}} + * {{¬es}} + {{/notes}} + {{#summary}} + * {{&summary}} + {{/summary}} + */ {{^useSingleRequestParameter}} async {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}}{{#hasMore}}, {{/hasMore}}{{/allParams}}): Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> { {{#returnType}} diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/modelGeneric.mustache index e2ee93cb1af3..b2975124edb3 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/modelGeneric.mustache @@ -100,7 +100,7 @@ export function {{classname}}FromJSONTyped(json: any, ignoreDiscriminator: boole {{/hasVars}} } -export function {{classname}}ToJSON(value?: {{classname}}): any { +export function {{classname}}ToJSON(value?: {{classname}} | null): any { {{#hasVars}} if (value === undefined) { return undefined; @@ -116,14 +116,14 @@ export function {{classname}}ToJSON(value?: {{classname}}): any { {{#vars}} {{^isReadOnly}} {{#isPrimitiveType}} - '{{baseName}}': {{#isDate}}{{^required}}value.{{name}} === undefined ? undefined : {{/required}}value.{{name}}.toISOString().substr(0,10){{/isDate}}{{#isDateTime}}{{^required}}value.{{name}} === undefined ? undefined : {{/required}}value.{{name}}.toISOString(){{/isDateTime}}{{^isDate}}{{^isDateTime}}value.{{name}}{{/isDateTime}}{{/isDate}}, + '{{baseName}}': {{#isDate}}{{^required}}value.{{name}} == null ? undefined : {{/required}}value.{{name}}.toISOString().substr(0,10){{/isDate}}{{#isDateTime}}{{^required}}value.{{name}} == null ? undefined : {{/required}}value.{{name}}.toISOString(){{/isDateTime}}{{^isDate}}{{^isDateTime}}value.{{name}}{{/isDateTime}}{{/isDate}}, {{/isPrimitiveType}} {{^isPrimitiveType}} {{#isListContainer}} - '{{baseName}}': {{^required}}value.{{name}} === undefined ? undefined : {{/required}}(value.{{name}} as Array).map({{#items}}{{datatype}}{{/items}}ToJSON), + '{{baseName}}': {{^required}}value.{{name}} == null ? undefined : {{/required}}(value.{{name}} as Array).map({{#items}}{{datatype}}{{/items}}ToJSON), {{/isListContainer}} {{#isMapContainer}} - '{{baseName}}': {{^required}}value.{{name}} === undefined ? undefined : {{/required}}mapValues(value.{{name}}, {{#items}}{{datatype}}{{/items}}ToJSON), + '{{baseName}}': {{^required}}value.{{name}} == null ? undefined : {{/required}}mapValues(value.{{name}}, {{#items}}{{datatype}}{{/items}}ToJSON), {{/isMapContainer}} {{^isListContainer}} {{^isMapContainer}} From 7c2610314d219f7c0cc7c75076a219fead887286 Mon Sep 17 00:00:00 2001 From: Vladimir Jimenez Date: Thu, 19 Sep 2019 21:32:01 -0700 Subject: [PATCH 2/3] [typescript][fetch] update sample generations --- .../builds/default/src/apis/PetApi.ts | 54 +++++++++---------- .../builds/default/src/apis/StoreApi.ts | 30 +++++------ .../builds/default/src/apis/UserApi.ts | 54 +++++++++---------- .../builds/default/src/models/Category.ts | 2 +- .../default/src/models/ModelApiResponse.ts | 2 +- .../builds/default/src/models/Order.ts | 4 +- .../builds/default/src/models/Pet.ts | 4 +- .../builds/default/src/models/Tag.ts | 2 +- .../builds/default/src/models/User.ts | 2 +- 9 files changed, 77 insertions(+), 77 deletions(-) diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/default/src/apis/PetApi.ts index e43896cc2929..1fcb27ef1c5e 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/src/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/src/apis/PetApi.ts @@ -98,9 +98,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Add a new pet to the store - */ + /** + * Add a new pet to the store + */ async addPet(requestParameters: AddPetRequest): Promise { await this.addPetRaw(requestParameters); } @@ -140,9 +140,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Deletes a pet - */ + /** + * Deletes a pet + */ async deletePet(requestParameters: DeletePetRequest): Promise { await this.deletePetRaw(requestParameters); } @@ -183,10 +183,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PetFromJSON)); } - /** - * Multiple status values can be provided with comma separated strings - * Finds Pets by status - */ + /** + * Multiple status values can be provided with comma separated strings + * Finds Pets by status + */ async findPetsByStatus(requestParameters: FindPetsByStatusRequest): Promise> { const response = await this.findPetsByStatusRaw(requestParameters); return await response.value(); @@ -228,10 +228,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PetFromJSON)); } - /** - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Finds Pets by tags - */ + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Finds Pets by tags + */ async findPetsByTags(requestParameters: FindPetsByTagsRequest): Promise> { const response = await this.findPetsByTagsRaw(requestParameters); return await response.value(); @@ -264,10 +264,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => PetFromJSON(jsonValue)); } - /** - * Returns a single pet - * Find pet by ID - */ + /** + * Returns a single pet + * Find pet by ID + */ async getPetById(requestParameters: GetPetByIdRequest): Promise { const response = await this.getPetByIdRaw(requestParameters); return await response.value(); @@ -307,9 +307,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Update an existing pet - */ + /** + * Update an existing pet + */ async updatePet(requestParameters: UpdatePetRequest): Promise { await this.updatePetRaw(requestParameters); } @@ -355,9 +355,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Updates a pet in the store with form data - */ + /** + * Updates a pet in the store with form data + */ async updatePetWithForm(requestParameters: UpdatePetWithFormRequest): Promise { await this.updatePetWithFormRaw(requestParameters); } @@ -403,9 +403,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => ModelApiResponseFromJSON(jsonValue)); } - /** - * uploads an image - */ + /** + * uploads an image + */ async uploadFile(requestParameters: UploadFileRequest): Promise { const response = await this.uploadFileRaw(requestParameters); return await response.value(); diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/default/src/apis/StoreApi.ts index 916660981657..4b645dea987e 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/src/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/src/apis/StoreApi.ts @@ -59,10 +59,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete purchase order by ID - */ + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete purchase order by ID + */ async deleteOrder(requestParameters: DeleteOrderRequest): Promise { await this.deleteOrderRaw(requestParameters); } @@ -90,10 +90,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response); } - /** - * Returns a map of status codes to quantities - * Returns pet inventories by status - */ + /** + * Returns a map of status codes to quantities + * Returns pet inventories by status + */ async getInventory(): Promise<{ [key: string]: number; }> { const response = await this.getInventoryRaw(); return await response.value(); @@ -122,10 +122,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); } - /** - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Find purchase order by ID - */ + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Find purchase order by ID + */ async getOrderById(requestParameters: GetOrderByIdRequest): Promise { const response = await this.getOrderByIdRaw(requestParameters); return await response.value(); @@ -156,9 +156,9 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); } - /** - * Place an order for a pet - */ + /** + * Place an order for a pet + */ async placeOrder(requestParameters: PlaceOrderRequest): Promise { const response = await this.placeOrderRaw(requestParameters); return await response.value(); diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/default/src/apis/UserApi.ts index 1696b600f57f..4126b817ee94 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/src/apis/UserApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/src/apis/UserApi.ts @@ -80,10 +80,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Create user - */ + /** + * This can only be done by the logged in user. + * Create user + */ async createUser(requestParameters: CreateUserRequest): Promise { await this.createUserRaw(requestParameters); } @@ -113,9 +113,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Creates list of users with given input array - */ + /** + * Creates list of users with given input array + */ async createUsersWithArrayInput(requestParameters: CreateUsersWithArrayInputRequest): Promise { await this.createUsersWithArrayInputRaw(requestParameters); } @@ -145,9 +145,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Creates list of users with given input array - */ + /** + * Creates list of users with given input array + */ async createUsersWithListInput(requestParameters: CreateUsersWithListInputRequest): Promise { await this.createUsersWithListInputRaw(requestParameters); } @@ -175,10 +175,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Delete user - */ + /** + * This can only be done by the logged in user. + * Delete user + */ async deleteUser(requestParameters: DeleteUserRequest): Promise { await this.deleteUserRaw(requestParameters); } @@ -205,9 +205,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue)); } - /** - * Get user by user name - */ + /** + * Get user by user name + */ async getUserByName(requestParameters: GetUserByNameRequest): Promise { const response = await this.getUserByNameRaw(requestParameters); return await response.value(); @@ -247,9 +247,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.TextApiResponse(response); } - /** - * Logs user into the system - */ + /** + * Logs user into the system + */ async loginUser(requestParameters: LoginUserRequest): Promise { const response = await this.loginUserRaw(requestParameters); return await response.value(); @@ -273,9 +273,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Logs out current logged in user session - */ + /** + * Logs out current logged in user session + */ async logoutUser(): Promise { await this.logoutUserRaw(); } @@ -310,10 +310,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Updated user - */ + /** + * This can only be done by the logged in user. + * Updated user + */ async updateUser(requestParameters: UpdateUserRequest): Promise { await this.updateUserRaw(requestParameters); } diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/Category.ts index 0541f013a256..7e3076d412d2 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/src/models/Category.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/src/models/Category.ts @@ -47,7 +47,7 @@ export function CategoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): }; } -export function CategoryToJSON(value?: Category): any { +export function CategoryToJSON(value?: Category | null): any { if (value === undefined) { return undefined; } diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/ModelApiResponse.ts index a9f1ef2fa241..c89b98fc62be 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/src/models/ModelApiResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/src/models/ModelApiResponse.ts @@ -54,7 +54,7 @@ export function ModelApiResponseFromJSONTyped(json: any, ignoreDiscriminator: bo }; } -export function ModelApiResponseToJSON(value?: ModelApiResponse): any { +export function ModelApiResponseToJSON(value?: ModelApiResponse | null): any { if (value === undefined) { return undefined; } diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/Order.ts index b9d32f387afb..da4ad33711d6 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/src/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/src/models/Order.ts @@ -75,7 +75,7 @@ export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Ord }; } -export function OrderToJSON(value?: Order): any { +export function OrderToJSON(value?: Order | null): any { if (value === undefined) { return undefined; } @@ -87,7 +87,7 @@ export function OrderToJSON(value?: Order): any { 'id': value.id, 'petId': value.petId, 'quantity': value.quantity, - 'shipDate': value.shipDate === undefined ? undefined : value.shipDate.toISOString(), + 'shipDate': value.shipDate == null ? undefined : value.shipDate.toISOString(), 'status': value.status, 'complete': value.complete, }; diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/Pet.ts index d0cf8f55c2c4..8f921c6b159f 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/src/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/src/models/Pet.ts @@ -86,7 +86,7 @@ export function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet { }; } -export function PetToJSON(value?: Pet): any { +export function PetToJSON(value?: Pet | null): any { if (value === undefined) { return undefined; } @@ -99,7 +99,7 @@ export function PetToJSON(value?: Pet): any { 'category': CategoryToJSON(value.category), 'name': value.name, 'photoUrls': value.photoUrls, - 'tags': value.tags === undefined ? undefined : (value.tags as Array).map(TagToJSON), + 'tags': value.tags == null ? undefined : (value.tags as Array).map(TagToJSON), 'status': value.status, }; } diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/Tag.ts index a095d07d0c05..5ea1fd63e818 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/src/models/Tag.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/src/models/Tag.ts @@ -47,7 +47,7 @@ export function TagFromJSONTyped(json: any, ignoreDiscriminator: boolean): Tag { }; } -export function TagToJSON(value?: Tag): any { +export function TagToJSON(value?: Tag | null): any { if (value === undefined) { return undefined; } diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/models/User.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/User.ts index 0649d0e1229c..302960bfef96 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/src/models/User.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/src/models/User.ts @@ -89,7 +89,7 @@ export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User }; } -export function UserToJSON(value?: User): any { +export function UserToJSON(value?: User | null): any { if (value === undefined) { return undefined; } From b3f83a1a339ee0db3d47a5875170bcc5fcda62ed Mon Sep 17 00:00:00 2001 From: Esteban Gehring Date: Fri, 20 Sep 2019 09:05:00 +0200 Subject: [PATCH 3/3] re-generate samples --- .../builds/es6-target/src/apis/PetApi.ts | 54 +++++++++---------- .../builds/es6-target/src/apis/StoreApi.ts | 30 +++++------ .../builds/es6-target/src/apis/UserApi.ts | 54 +++++++++---------- .../builds/es6-target/src/models/Category.ts | 2 +- .../es6-target/src/models/ModelApiResponse.ts | 2 +- .../builds/es6-target/src/models/Order.ts | 4 +- .../builds/es6-target/src/models/Pet.ts | 4 +- .../builds/es6-target/src/models/Tag.ts | 2 +- .../builds/es6-target/src/models/User.ts | 2 +- .../multiple-parameters/src/apis/PetApi.ts | 54 +++++++++---------- .../multiple-parameters/src/apis/StoreApi.ts | 30 +++++------ .../multiple-parameters/src/apis/UserApi.ts | 54 +++++++++---------- .../src/models/Category.ts | 2 +- .../src/models/ModelApiResponse.ts | 2 +- .../multiple-parameters/src/models/Order.ts | 4 +- .../multiple-parameters/src/models/Pet.ts | 4 +- .../multiple-parameters/src/models/Tag.ts | 2 +- .../multiple-parameters/src/models/User.ts | 2 +- .../src/apis/PetApi.ts | 54 +++++++++---------- .../src/apis/StoreApi.ts | 30 +++++------ .../src/apis/UserApi.ts | 54 +++++++++---------- .../src/models/Category.ts | 2 +- .../src/models/ModelApiResponse.ts | 2 +- .../src/models/Order.ts | 4 +- .../src/models/Pet.ts | 4 +- .../src/models/Tag.ts | 2 +- .../src/models/User.ts | 2 +- .../typescript-three-plus/src/apis/PetApi.ts | 54 +++++++++---------- .../src/apis/StoreApi.ts | 30 +++++------ .../typescript-three-plus/src/apis/UserApi.ts | 54 +++++++++---------- .../src/models/Category.ts | 2 +- .../src/models/ModelApiResponse.ts | 2 +- .../typescript-three-plus/src/models/Order.ts | 4 +- .../typescript-three-plus/src/models/Pet.ts | 4 +- .../typescript-three-plus/src/models/Tag.ts | 2 +- .../typescript-three-plus/src/models/User.ts | 2 +- .../builds/with-interfaces/src/apis/PetApi.ts | 54 +++++++++---------- .../with-interfaces/src/apis/StoreApi.ts | 30 +++++------ .../with-interfaces/src/apis/UserApi.ts | 54 +++++++++---------- .../with-interfaces/src/models/Category.ts | 2 +- .../src/models/ModelApiResponse.ts | 2 +- .../with-interfaces/src/models/Order.ts | 4 +- .../builds/with-interfaces/src/models/Pet.ts | 4 +- .../builds/with-interfaces/src/models/Tag.ts | 2 +- .../builds/with-interfaces/src/models/User.ts | 2 +- .../with-npm-version/src/apis/PetApi.ts | 54 +++++++++---------- .../with-npm-version/src/apis/StoreApi.ts | 30 +++++------ .../with-npm-version/src/apis/UserApi.ts | 54 +++++++++---------- .../with-npm-version/src/models/Category.ts | 2 +- .../src/models/ModelApiResponse.ts | 2 +- .../with-npm-version/src/models/Order.ts | 4 +- .../builds/with-npm-version/src/models/Pet.ts | 4 +- .../builds/with-npm-version/src/models/Tag.ts | 2 +- .../with-npm-version/src/models/User.ts | 2 +- 54 files changed, 462 insertions(+), 462 deletions(-) diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/PetApi.ts index e43896cc2929..1fcb27ef1c5e 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/PetApi.ts @@ -98,9 +98,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Add a new pet to the store - */ + /** + * Add a new pet to the store + */ async addPet(requestParameters: AddPetRequest): Promise { await this.addPetRaw(requestParameters); } @@ -140,9 +140,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Deletes a pet - */ + /** + * Deletes a pet + */ async deletePet(requestParameters: DeletePetRequest): Promise { await this.deletePetRaw(requestParameters); } @@ -183,10 +183,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PetFromJSON)); } - /** - * Multiple status values can be provided with comma separated strings - * Finds Pets by status - */ + /** + * Multiple status values can be provided with comma separated strings + * Finds Pets by status + */ async findPetsByStatus(requestParameters: FindPetsByStatusRequest): Promise> { const response = await this.findPetsByStatusRaw(requestParameters); return await response.value(); @@ -228,10 +228,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PetFromJSON)); } - /** - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Finds Pets by tags - */ + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Finds Pets by tags + */ async findPetsByTags(requestParameters: FindPetsByTagsRequest): Promise> { const response = await this.findPetsByTagsRaw(requestParameters); return await response.value(); @@ -264,10 +264,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => PetFromJSON(jsonValue)); } - /** - * Returns a single pet - * Find pet by ID - */ + /** + * Returns a single pet + * Find pet by ID + */ async getPetById(requestParameters: GetPetByIdRequest): Promise { const response = await this.getPetByIdRaw(requestParameters); return await response.value(); @@ -307,9 +307,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Update an existing pet - */ + /** + * Update an existing pet + */ async updatePet(requestParameters: UpdatePetRequest): Promise { await this.updatePetRaw(requestParameters); } @@ -355,9 +355,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Updates a pet in the store with form data - */ + /** + * Updates a pet in the store with form data + */ async updatePetWithForm(requestParameters: UpdatePetWithFormRequest): Promise { await this.updatePetWithFormRaw(requestParameters); } @@ -403,9 +403,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => ModelApiResponseFromJSON(jsonValue)); } - /** - * uploads an image - */ + /** + * uploads an image + */ async uploadFile(requestParameters: UploadFileRequest): Promise { const response = await this.uploadFileRaw(requestParameters); return await response.value(); diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/StoreApi.ts index 916660981657..4b645dea987e 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/StoreApi.ts @@ -59,10 +59,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete purchase order by ID - */ + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete purchase order by ID + */ async deleteOrder(requestParameters: DeleteOrderRequest): Promise { await this.deleteOrderRaw(requestParameters); } @@ -90,10 +90,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response); } - /** - * Returns a map of status codes to quantities - * Returns pet inventories by status - */ + /** + * Returns a map of status codes to quantities + * Returns pet inventories by status + */ async getInventory(): Promise<{ [key: string]: number; }> { const response = await this.getInventoryRaw(); return await response.value(); @@ -122,10 +122,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); } - /** - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Find purchase order by ID - */ + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Find purchase order by ID + */ async getOrderById(requestParameters: GetOrderByIdRequest): Promise { const response = await this.getOrderByIdRaw(requestParameters); return await response.value(); @@ -156,9 +156,9 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); } - /** - * Place an order for a pet - */ + /** + * Place an order for a pet + */ async placeOrder(requestParameters: PlaceOrderRequest): Promise { const response = await this.placeOrderRaw(requestParameters); return await response.value(); diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/UserApi.ts index 1696b600f57f..4126b817ee94 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/UserApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/UserApi.ts @@ -80,10 +80,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Create user - */ + /** + * This can only be done by the logged in user. + * Create user + */ async createUser(requestParameters: CreateUserRequest): Promise { await this.createUserRaw(requestParameters); } @@ -113,9 +113,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Creates list of users with given input array - */ + /** + * Creates list of users with given input array + */ async createUsersWithArrayInput(requestParameters: CreateUsersWithArrayInputRequest): Promise { await this.createUsersWithArrayInputRaw(requestParameters); } @@ -145,9 +145,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Creates list of users with given input array - */ + /** + * Creates list of users with given input array + */ async createUsersWithListInput(requestParameters: CreateUsersWithListInputRequest): Promise { await this.createUsersWithListInputRaw(requestParameters); } @@ -175,10 +175,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Delete user - */ + /** + * This can only be done by the logged in user. + * Delete user + */ async deleteUser(requestParameters: DeleteUserRequest): Promise { await this.deleteUserRaw(requestParameters); } @@ -205,9 +205,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue)); } - /** - * Get user by user name - */ + /** + * Get user by user name + */ async getUserByName(requestParameters: GetUserByNameRequest): Promise { const response = await this.getUserByNameRaw(requestParameters); return await response.value(); @@ -247,9 +247,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.TextApiResponse(response); } - /** - * Logs user into the system - */ + /** + * Logs user into the system + */ async loginUser(requestParameters: LoginUserRequest): Promise { const response = await this.loginUserRaw(requestParameters); return await response.value(); @@ -273,9 +273,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Logs out current logged in user session - */ + /** + * Logs out current logged in user session + */ async logoutUser(): Promise { await this.logoutUserRaw(); } @@ -310,10 +310,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Updated user - */ + /** + * This can only be done by the logged in user. + * Updated user + */ async updateUser(requestParameters: UpdateUserRequest): Promise { await this.updateUserRaw(requestParameters); } diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Category.ts index 0541f013a256..7e3076d412d2 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Category.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Category.ts @@ -47,7 +47,7 @@ export function CategoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): }; } -export function CategoryToJSON(value?: Category): any { +export function CategoryToJSON(value?: Category | null): any { if (value === undefined) { return undefined; } diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/ModelApiResponse.ts index a9f1ef2fa241..c89b98fc62be 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/ModelApiResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/ModelApiResponse.ts @@ -54,7 +54,7 @@ export function ModelApiResponseFromJSONTyped(json: any, ignoreDiscriminator: bo }; } -export function ModelApiResponseToJSON(value?: ModelApiResponse): any { +export function ModelApiResponseToJSON(value?: ModelApiResponse | null): any { if (value === undefined) { return undefined; } diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Order.ts index b9d32f387afb..da4ad33711d6 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Order.ts @@ -75,7 +75,7 @@ export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Ord }; } -export function OrderToJSON(value?: Order): any { +export function OrderToJSON(value?: Order | null): any { if (value === undefined) { return undefined; } @@ -87,7 +87,7 @@ export function OrderToJSON(value?: Order): any { 'id': value.id, 'petId': value.petId, 'quantity': value.quantity, - 'shipDate': value.shipDate === undefined ? undefined : value.shipDate.toISOString(), + 'shipDate': value.shipDate == null ? undefined : value.shipDate.toISOString(), 'status': value.status, 'complete': value.complete, }; diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Pet.ts index d0cf8f55c2c4..8f921c6b159f 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Pet.ts @@ -86,7 +86,7 @@ export function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet { }; } -export function PetToJSON(value?: Pet): any { +export function PetToJSON(value?: Pet | null): any { if (value === undefined) { return undefined; } @@ -99,7 +99,7 @@ export function PetToJSON(value?: Pet): any { 'category': CategoryToJSON(value.category), 'name': value.name, 'photoUrls': value.photoUrls, - 'tags': value.tags === undefined ? undefined : (value.tags as Array).map(TagToJSON), + 'tags': value.tags == null ? undefined : (value.tags as Array).map(TagToJSON), 'status': value.status, }; } diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Tag.ts index a095d07d0c05..5ea1fd63e818 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Tag.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Tag.ts @@ -47,7 +47,7 @@ export function TagFromJSONTyped(json: any, ignoreDiscriminator: boolean): Tag { }; } -export function TagToJSON(value?: Tag): any { +export function TagToJSON(value?: Tag | null): any { if (value === undefined) { return undefined; } diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/User.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/User.ts index 0649d0e1229c..302960bfef96 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/User.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/User.ts @@ -89,7 +89,7 @@ export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User }; } -export function UserToJSON(value?: User): any { +export function UserToJSON(value?: User | null): any { if (value === undefined) { return undefined; } diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/PetApi.ts index e3501ab3f26a..786513ad7d7f 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/PetApi.ts @@ -98,9 +98,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Add a new pet to the store - */ + /** + * Add a new pet to the store + */ async addPet(body: Pet): Promise { await this.addPetRaw({ body: body }); } @@ -140,9 +140,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Deletes a pet - */ + /** + * Deletes a pet + */ async deletePet(petId: number, apiKey?: string): Promise { await this.deletePetRaw({ petId: petId, apiKey: apiKey }); } @@ -183,10 +183,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PetFromJSON)); } - /** - * Multiple status values can be provided with comma separated strings - * Finds Pets by status - */ + /** + * Multiple status values can be provided with comma separated strings + * Finds Pets by status + */ async findPetsByStatus(status: Array): Promise> { const response = await this.findPetsByStatusRaw({ status: status }); return await response.value(); @@ -228,10 +228,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PetFromJSON)); } - /** - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Finds Pets by tags - */ + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Finds Pets by tags + */ async findPetsByTags(tags: Array): Promise> { const response = await this.findPetsByTagsRaw({ tags: tags }); return await response.value(); @@ -264,10 +264,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => PetFromJSON(jsonValue)); } - /** - * Returns a single pet - * Find pet by ID - */ + /** + * Returns a single pet + * Find pet by ID + */ async getPetById(petId: number): Promise { const response = await this.getPetByIdRaw({ petId: petId }); return await response.value(); @@ -307,9 +307,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Update an existing pet - */ + /** + * Update an existing pet + */ async updatePet(body: Pet): Promise { await this.updatePetRaw({ body: body }); } @@ -355,9 +355,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Updates a pet in the store with form data - */ + /** + * Updates a pet in the store with form data + */ async updatePetWithForm(petId: number, name?: string, status?: string): Promise { await this.updatePetWithFormRaw({ petId: petId, name: name, status: status }); } @@ -403,9 +403,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => ModelApiResponseFromJSON(jsonValue)); } - /** - * uploads an image - */ + /** + * uploads an image + */ async uploadFile(petId: number, additionalMetadata?: string, file?: Blob): Promise { const response = await this.uploadFileRaw({ petId: petId, additionalMetadata: additionalMetadata, file: file }); return await response.value(); diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/StoreApi.ts index 5b3424aafba4..e8635189f620 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/StoreApi.ts @@ -59,10 +59,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete purchase order by ID - */ + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete purchase order by ID + */ async deleteOrder(orderId: string): Promise { await this.deleteOrderRaw({ orderId: orderId }); } @@ -90,10 +90,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response); } - /** - * Returns a map of status codes to quantities - * Returns pet inventories by status - */ + /** + * Returns a map of status codes to quantities + * Returns pet inventories by status + */ async getInventory(): Promise<{ [key: string]: number; }> { const response = await this.getInventoryRaw(); return await response.value(); @@ -122,10 +122,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); } - /** - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Find purchase order by ID - */ + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Find purchase order by ID + */ async getOrderById(orderId: number): Promise { const response = await this.getOrderByIdRaw({ orderId: orderId }); return await response.value(); @@ -156,9 +156,9 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); } - /** - * Place an order for a pet - */ + /** + * Place an order for a pet + */ async placeOrder(body: Order): Promise { const response = await this.placeOrderRaw({ body: body }); return await response.value(); diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/UserApi.ts index 443e52fe2c2f..ce75bed4fd16 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/UserApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/UserApi.ts @@ -80,10 +80,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Create user - */ + /** + * This can only be done by the logged in user. + * Create user + */ async createUser(body: User): Promise { await this.createUserRaw({ body: body }); } @@ -113,9 +113,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Creates list of users with given input array - */ + /** + * Creates list of users with given input array + */ async createUsersWithArrayInput(body: Array): Promise { await this.createUsersWithArrayInputRaw({ body: body }); } @@ -145,9 +145,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Creates list of users with given input array - */ + /** + * Creates list of users with given input array + */ async createUsersWithListInput(body: Array): Promise { await this.createUsersWithListInputRaw({ body: body }); } @@ -175,10 +175,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Delete user - */ + /** + * This can only be done by the logged in user. + * Delete user + */ async deleteUser(username: string): Promise { await this.deleteUserRaw({ username: username }); } @@ -205,9 +205,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue)); } - /** - * Get user by user name - */ + /** + * Get user by user name + */ async getUserByName(username: string): Promise { const response = await this.getUserByNameRaw({ username: username }); return await response.value(); @@ -247,9 +247,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.TextApiResponse(response); } - /** - * Logs user into the system - */ + /** + * Logs user into the system + */ async loginUser(username: string, password: string): Promise { const response = await this.loginUserRaw({ username: username, password: password }); return await response.value(); @@ -273,9 +273,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Logs out current logged in user session - */ + /** + * Logs out current logged in user session + */ async logoutUser(): Promise { await this.logoutUserRaw(); } @@ -310,10 +310,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Updated user - */ + /** + * This can only be done by the logged in user. + * Updated user + */ async updateUser(username: string, body: User): Promise { await this.updateUserRaw({ username: username, body: body }); } diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Category.ts index 0541f013a256..7e3076d412d2 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Category.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Category.ts @@ -47,7 +47,7 @@ export function CategoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): }; } -export function CategoryToJSON(value?: Category): any { +export function CategoryToJSON(value?: Category | null): any { if (value === undefined) { return undefined; } diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/ModelApiResponse.ts index a9f1ef2fa241..c89b98fc62be 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/ModelApiResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/ModelApiResponse.ts @@ -54,7 +54,7 @@ export function ModelApiResponseFromJSONTyped(json: any, ignoreDiscriminator: bo }; } -export function ModelApiResponseToJSON(value?: ModelApiResponse): any { +export function ModelApiResponseToJSON(value?: ModelApiResponse | null): any { if (value === undefined) { return undefined; } diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Order.ts index b9d32f387afb..da4ad33711d6 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Order.ts @@ -75,7 +75,7 @@ export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Ord }; } -export function OrderToJSON(value?: Order): any { +export function OrderToJSON(value?: Order | null): any { if (value === undefined) { return undefined; } @@ -87,7 +87,7 @@ export function OrderToJSON(value?: Order): any { 'id': value.id, 'petId': value.petId, 'quantity': value.quantity, - 'shipDate': value.shipDate === undefined ? undefined : value.shipDate.toISOString(), + 'shipDate': value.shipDate == null ? undefined : value.shipDate.toISOString(), 'status': value.status, 'complete': value.complete, }; diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Pet.ts index d0cf8f55c2c4..8f921c6b159f 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Pet.ts @@ -86,7 +86,7 @@ export function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet { }; } -export function PetToJSON(value?: Pet): any { +export function PetToJSON(value?: Pet | null): any { if (value === undefined) { return undefined; } @@ -99,7 +99,7 @@ export function PetToJSON(value?: Pet): any { 'category': CategoryToJSON(value.category), 'name': value.name, 'photoUrls': value.photoUrls, - 'tags': value.tags === undefined ? undefined : (value.tags as Array).map(TagToJSON), + 'tags': value.tags == null ? undefined : (value.tags as Array).map(TagToJSON), 'status': value.status, }; } diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Tag.ts index a095d07d0c05..5ea1fd63e818 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Tag.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Tag.ts @@ -47,7 +47,7 @@ export function TagFromJSONTyped(json: any, ignoreDiscriminator: boolean): Tag { }; } -export function TagToJSON(value?: Tag): any { +export function TagToJSON(value?: Tag | null): any { if (value === undefined) { return undefined; } diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/User.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/User.ts index 0649d0e1229c..302960bfef96 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/User.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/User.ts @@ -89,7 +89,7 @@ export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User }; } -export function UserToJSON(value?: User): any { +export function UserToJSON(value?: User | null): any { if (value === undefined) { return undefined; } diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/PetApi.ts index 60dc1750c8ac..1e5dc0803e00 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/PetApi.ts @@ -98,9 +98,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Add a new pet to the store - */ + /** + * Add a new pet to the store + */ async addPet(requestParameters: PetApiAddPetRequest): Promise { await this.addPetRaw(requestParameters); } @@ -140,9 +140,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Deletes a pet - */ + /** + * Deletes a pet + */ async deletePet(requestParameters: PetApiDeletePetRequest): Promise { await this.deletePetRaw(requestParameters); } @@ -183,10 +183,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PetFromJSON)); } - /** - * Multiple status values can be provided with comma separated strings - * Finds Pets by status - */ + /** + * Multiple status values can be provided with comma separated strings + * Finds Pets by status + */ async findPetsByStatus(requestParameters: PetApiFindPetsByStatusRequest): Promise> { const response = await this.findPetsByStatusRaw(requestParameters); return await response.value(); @@ -228,10 +228,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PetFromJSON)); } - /** - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Finds Pets by tags - */ + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Finds Pets by tags + */ async findPetsByTags(requestParameters: PetApiFindPetsByTagsRequest): Promise> { const response = await this.findPetsByTagsRaw(requestParameters); return await response.value(); @@ -264,10 +264,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => PetFromJSON(jsonValue)); } - /** - * Returns a single pet - * Find pet by ID - */ + /** + * Returns a single pet + * Find pet by ID + */ async getPetById(requestParameters: PetApiGetPetByIdRequest): Promise { const response = await this.getPetByIdRaw(requestParameters); return await response.value(); @@ -307,9 +307,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Update an existing pet - */ + /** + * Update an existing pet + */ async updatePet(requestParameters: PetApiUpdatePetRequest): Promise { await this.updatePetRaw(requestParameters); } @@ -355,9 +355,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Updates a pet in the store with form data - */ + /** + * Updates a pet in the store with form data + */ async updatePetWithForm(requestParameters: PetApiUpdatePetWithFormRequest): Promise { await this.updatePetWithFormRaw(requestParameters); } @@ -403,9 +403,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => ModelApiResponseFromJSON(jsonValue)); } - /** - * uploads an image - */ + /** + * uploads an image + */ async uploadFile(requestParameters: PetApiUploadFileRequest): Promise { const response = await this.uploadFileRaw(requestParameters); return await response.value(); diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/StoreApi.ts index 74848a98eaae..cfe73a1da647 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/StoreApi.ts @@ -59,10 +59,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete purchase order by ID - */ + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete purchase order by ID + */ async deleteOrder(requestParameters: StoreApiDeleteOrderRequest): Promise { await this.deleteOrderRaw(requestParameters); } @@ -90,10 +90,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response); } - /** - * Returns a map of status codes to quantities - * Returns pet inventories by status - */ + /** + * Returns a map of status codes to quantities + * Returns pet inventories by status + */ async getInventory(): Promise<{ [key: string]: number; }> { const response = await this.getInventoryRaw(); return await response.value(); @@ -122,10 +122,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); } - /** - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Find purchase order by ID - */ + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Find purchase order by ID + */ async getOrderById(requestParameters: StoreApiGetOrderByIdRequest): Promise { const response = await this.getOrderByIdRaw(requestParameters); return await response.value(); @@ -156,9 +156,9 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); } - /** - * Place an order for a pet - */ + /** + * Place an order for a pet + */ async placeOrder(requestParameters: StoreApiPlaceOrderRequest): Promise { const response = await this.placeOrderRaw(requestParameters); return await response.value(); diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/UserApi.ts index ed4f39ed0c9c..f28cd54fc893 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/UserApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/UserApi.ts @@ -80,10 +80,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Create user - */ + /** + * This can only be done by the logged in user. + * Create user + */ async createUser(requestParameters: UserApiCreateUserRequest): Promise { await this.createUserRaw(requestParameters); } @@ -113,9 +113,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Creates list of users with given input array - */ + /** + * Creates list of users with given input array + */ async createUsersWithArrayInput(requestParameters: UserApiCreateUsersWithArrayInputRequest): Promise { await this.createUsersWithArrayInputRaw(requestParameters); } @@ -145,9 +145,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Creates list of users with given input array - */ + /** + * Creates list of users with given input array + */ async createUsersWithListInput(requestParameters: UserApiCreateUsersWithListInputRequest): Promise { await this.createUsersWithListInputRaw(requestParameters); } @@ -175,10 +175,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Delete user - */ + /** + * This can only be done by the logged in user. + * Delete user + */ async deleteUser(requestParameters: UserApiDeleteUserRequest): Promise { await this.deleteUserRaw(requestParameters); } @@ -205,9 +205,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue)); } - /** - * Get user by user name - */ + /** + * Get user by user name + */ async getUserByName(requestParameters: UserApiGetUserByNameRequest): Promise { const response = await this.getUserByNameRaw(requestParameters); return await response.value(); @@ -247,9 +247,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.TextApiResponse(response); } - /** - * Logs user into the system - */ + /** + * Logs user into the system + */ async loginUser(requestParameters: UserApiLoginUserRequest): Promise { const response = await this.loginUserRaw(requestParameters); return await response.value(); @@ -273,9 +273,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Logs out current logged in user session - */ + /** + * Logs out current logged in user session + */ async logoutUser(): Promise { await this.logoutUserRaw(); } @@ -310,10 +310,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Updated user - */ + /** + * This can only be done by the logged in user. + * Updated user + */ async updateUser(requestParameters: UserApiUpdateUserRequest): Promise { await this.updateUserRaw(requestParameters); } diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Category.ts index 0541f013a256..7e3076d412d2 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Category.ts +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Category.ts @@ -47,7 +47,7 @@ export function CategoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): }; } -export function CategoryToJSON(value?: Category): any { +export function CategoryToJSON(value?: Category | null): any { if (value === undefined) { return undefined; } diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/ModelApiResponse.ts index a9f1ef2fa241..c89b98fc62be 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/ModelApiResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/ModelApiResponse.ts @@ -54,7 +54,7 @@ export function ModelApiResponseFromJSONTyped(json: any, ignoreDiscriminator: bo }; } -export function ModelApiResponseToJSON(value?: ModelApiResponse): any { +export function ModelApiResponseToJSON(value?: ModelApiResponse | null): any { if (value === undefined) { return undefined; } diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Order.ts index b9d32f387afb..da4ad33711d6 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Order.ts @@ -75,7 +75,7 @@ export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Ord }; } -export function OrderToJSON(value?: Order): any { +export function OrderToJSON(value?: Order | null): any { if (value === undefined) { return undefined; } @@ -87,7 +87,7 @@ export function OrderToJSON(value?: Order): any { 'id': value.id, 'petId': value.petId, 'quantity': value.quantity, - 'shipDate': value.shipDate === undefined ? undefined : value.shipDate.toISOString(), + 'shipDate': value.shipDate == null ? undefined : value.shipDate.toISOString(), 'status': value.status, 'complete': value.complete, }; diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Pet.ts index d0cf8f55c2c4..8f921c6b159f 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Pet.ts @@ -86,7 +86,7 @@ export function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet { }; } -export function PetToJSON(value?: Pet): any { +export function PetToJSON(value?: Pet | null): any { if (value === undefined) { return undefined; } @@ -99,7 +99,7 @@ export function PetToJSON(value?: Pet): any { 'category': CategoryToJSON(value.category), 'name': value.name, 'photoUrls': value.photoUrls, - 'tags': value.tags === undefined ? undefined : (value.tags as Array).map(TagToJSON), + 'tags': value.tags == null ? undefined : (value.tags as Array).map(TagToJSON), 'status': value.status, }; } diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Tag.ts index a095d07d0c05..5ea1fd63e818 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Tag.ts +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Tag.ts @@ -47,7 +47,7 @@ export function TagFromJSONTyped(json: any, ignoreDiscriminator: boolean): Tag { }; } -export function TagToJSON(value?: Tag): any { +export function TagToJSON(value?: Tag | null): any { if (value === undefined) { return undefined; } diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/User.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/User.ts index 0649d0e1229c..302960bfef96 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/User.ts +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/User.ts @@ -89,7 +89,7 @@ export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User }; } -export function UserToJSON(value?: User): any { +export function UserToJSON(value?: User | null): any { if (value === undefined) { return undefined; } diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/apis/PetApi.ts index e43896cc2929..1fcb27ef1c5e 100644 --- a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/apis/PetApi.ts @@ -98,9 +98,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Add a new pet to the store - */ + /** + * Add a new pet to the store + */ async addPet(requestParameters: AddPetRequest): Promise { await this.addPetRaw(requestParameters); } @@ -140,9 +140,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Deletes a pet - */ + /** + * Deletes a pet + */ async deletePet(requestParameters: DeletePetRequest): Promise { await this.deletePetRaw(requestParameters); } @@ -183,10 +183,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PetFromJSON)); } - /** - * Multiple status values can be provided with comma separated strings - * Finds Pets by status - */ + /** + * Multiple status values can be provided with comma separated strings + * Finds Pets by status + */ async findPetsByStatus(requestParameters: FindPetsByStatusRequest): Promise> { const response = await this.findPetsByStatusRaw(requestParameters); return await response.value(); @@ -228,10 +228,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PetFromJSON)); } - /** - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Finds Pets by tags - */ + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Finds Pets by tags + */ async findPetsByTags(requestParameters: FindPetsByTagsRequest): Promise> { const response = await this.findPetsByTagsRaw(requestParameters); return await response.value(); @@ -264,10 +264,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => PetFromJSON(jsonValue)); } - /** - * Returns a single pet - * Find pet by ID - */ + /** + * Returns a single pet + * Find pet by ID + */ async getPetById(requestParameters: GetPetByIdRequest): Promise { const response = await this.getPetByIdRaw(requestParameters); return await response.value(); @@ -307,9 +307,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Update an existing pet - */ + /** + * Update an existing pet + */ async updatePet(requestParameters: UpdatePetRequest): Promise { await this.updatePetRaw(requestParameters); } @@ -355,9 +355,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Updates a pet in the store with form data - */ + /** + * Updates a pet in the store with form data + */ async updatePetWithForm(requestParameters: UpdatePetWithFormRequest): Promise { await this.updatePetWithFormRaw(requestParameters); } @@ -403,9 +403,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => ModelApiResponseFromJSON(jsonValue)); } - /** - * uploads an image - */ + /** + * uploads an image + */ async uploadFile(requestParameters: UploadFileRequest): Promise { const response = await this.uploadFileRaw(requestParameters); return await response.value(); diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/apis/StoreApi.ts index 916660981657..4b645dea987e 100644 --- a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/apis/StoreApi.ts @@ -59,10 +59,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete purchase order by ID - */ + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete purchase order by ID + */ async deleteOrder(requestParameters: DeleteOrderRequest): Promise { await this.deleteOrderRaw(requestParameters); } @@ -90,10 +90,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response); } - /** - * Returns a map of status codes to quantities - * Returns pet inventories by status - */ + /** + * Returns a map of status codes to quantities + * Returns pet inventories by status + */ async getInventory(): Promise<{ [key: string]: number; }> { const response = await this.getInventoryRaw(); return await response.value(); @@ -122,10 +122,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); } - /** - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Find purchase order by ID - */ + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Find purchase order by ID + */ async getOrderById(requestParameters: GetOrderByIdRequest): Promise { const response = await this.getOrderByIdRaw(requestParameters); return await response.value(); @@ -156,9 +156,9 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); } - /** - * Place an order for a pet - */ + /** + * Place an order for a pet + */ async placeOrder(requestParameters: PlaceOrderRequest): Promise { const response = await this.placeOrderRaw(requestParameters); return await response.value(); diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/apis/UserApi.ts index 1696b600f57f..4126b817ee94 100644 --- a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/apis/UserApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/apis/UserApi.ts @@ -80,10 +80,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Create user - */ + /** + * This can only be done by the logged in user. + * Create user + */ async createUser(requestParameters: CreateUserRequest): Promise { await this.createUserRaw(requestParameters); } @@ -113,9 +113,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Creates list of users with given input array - */ + /** + * Creates list of users with given input array + */ async createUsersWithArrayInput(requestParameters: CreateUsersWithArrayInputRequest): Promise { await this.createUsersWithArrayInputRaw(requestParameters); } @@ -145,9 +145,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Creates list of users with given input array - */ + /** + * Creates list of users with given input array + */ async createUsersWithListInput(requestParameters: CreateUsersWithListInputRequest): Promise { await this.createUsersWithListInputRaw(requestParameters); } @@ -175,10 +175,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Delete user - */ + /** + * This can only be done by the logged in user. + * Delete user + */ async deleteUser(requestParameters: DeleteUserRequest): Promise { await this.deleteUserRaw(requestParameters); } @@ -205,9 +205,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue)); } - /** - * Get user by user name - */ + /** + * Get user by user name + */ async getUserByName(requestParameters: GetUserByNameRequest): Promise { const response = await this.getUserByNameRaw(requestParameters); return await response.value(); @@ -247,9 +247,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.TextApiResponse(response); } - /** - * Logs user into the system - */ + /** + * Logs user into the system + */ async loginUser(requestParameters: LoginUserRequest): Promise { const response = await this.loginUserRaw(requestParameters); return await response.value(); @@ -273,9 +273,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Logs out current logged in user session - */ + /** + * Logs out current logged in user session + */ async logoutUser(): Promise { await this.logoutUserRaw(); } @@ -310,10 +310,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Updated user - */ + /** + * This can only be done by the logged in user. + * Updated user + */ async updateUser(requestParameters: UpdateUserRequest): Promise { await this.updateUserRaw(requestParameters); } diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Category.ts index 0541f013a256..7e3076d412d2 100644 --- a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Category.ts +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Category.ts @@ -47,7 +47,7 @@ export function CategoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): }; } -export function CategoryToJSON(value?: Category): any { +export function CategoryToJSON(value?: Category | null): any { if (value === undefined) { return undefined; } diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/ModelApiResponse.ts index a9f1ef2fa241..c89b98fc62be 100644 --- a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/ModelApiResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/ModelApiResponse.ts @@ -54,7 +54,7 @@ export function ModelApiResponseFromJSONTyped(json: any, ignoreDiscriminator: bo }; } -export function ModelApiResponseToJSON(value?: ModelApiResponse): any { +export function ModelApiResponseToJSON(value?: ModelApiResponse | null): any { if (value === undefined) { return undefined; } diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Order.ts index b9d32f387afb..da4ad33711d6 100644 --- a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Order.ts @@ -75,7 +75,7 @@ export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Ord }; } -export function OrderToJSON(value?: Order): any { +export function OrderToJSON(value?: Order | null): any { if (value === undefined) { return undefined; } @@ -87,7 +87,7 @@ export function OrderToJSON(value?: Order): any { 'id': value.id, 'petId': value.petId, 'quantity': value.quantity, - 'shipDate': value.shipDate === undefined ? undefined : value.shipDate.toISOString(), + 'shipDate': value.shipDate == null ? undefined : value.shipDate.toISOString(), 'status': value.status, 'complete': value.complete, }; diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Pet.ts index d0cf8f55c2c4..8f921c6b159f 100644 --- a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Pet.ts @@ -86,7 +86,7 @@ export function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet { }; } -export function PetToJSON(value?: Pet): any { +export function PetToJSON(value?: Pet | null): any { if (value === undefined) { return undefined; } @@ -99,7 +99,7 @@ export function PetToJSON(value?: Pet): any { 'category': CategoryToJSON(value.category), 'name': value.name, 'photoUrls': value.photoUrls, - 'tags': value.tags === undefined ? undefined : (value.tags as Array).map(TagToJSON), + 'tags': value.tags == null ? undefined : (value.tags as Array).map(TagToJSON), 'status': value.status, }; } diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Tag.ts index a095d07d0c05..5ea1fd63e818 100644 --- a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Tag.ts +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Tag.ts @@ -47,7 +47,7 @@ export function TagFromJSONTyped(json: any, ignoreDiscriminator: boolean): Tag { }; } -export function TagToJSON(value?: Tag): any { +export function TagToJSON(value?: Tag | null): any { if (value === undefined) { return undefined; } diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/User.ts b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/User.ts index 0649d0e1229c..302960bfef96 100644 --- a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/User.ts +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/User.ts @@ -89,7 +89,7 @@ export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User }; } -export function UserToJSON(value?: User): any { +export function UserToJSON(value?: User | null): any { if (value === undefined) { return undefined; } diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/PetApi.ts index e43896cc2929..1fcb27ef1c5e 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/PetApi.ts @@ -98,9 +98,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Add a new pet to the store - */ + /** + * Add a new pet to the store + */ async addPet(requestParameters: AddPetRequest): Promise { await this.addPetRaw(requestParameters); } @@ -140,9 +140,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Deletes a pet - */ + /** + * Deletes a pet + */ async deletePet(requestParameters: DeletePetRequest): Promise { await this.deletePetRaw(requestParameters); } @@ -183,10 +183,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PetFromJSON)); } - /** - * Multiple status values can be provided with comma separated strings - * Finds Pets by status - */ + /** + * Multiple status values can be provided with comma separated strings + * Finds Pets by status + */ async findPetsByStatus(requestParameters: FindPetsByStatusRequest): Promise> { const response = await this.findPetsByStatusRaw(requestParameters); return await response.value(); @@ -228,10 +228,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PetFromJSON)); } - /** - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Finds Pets by tags - */ + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Finds Pets by tags + */ async findPetsByTags(requestParameters: FindPetsByTagsRequest): Promise> { const response = await this.findPetsByTagsRaw(requestParameters); return await response.value(); @@ -264,10 +264,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => PetFromJSON(jsonValue)); } - /** - * Returns a single pet - * Find pet by ID - */ + /** + * Returns a single pet + * Find pet by ID + */ async getPetById(requestParameters: GetPetByIdRequest): Promise { const response = await this.getPetByIdRaw(requestParameters); return await response.value(); @@ -307,9 +307,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Update an existing pet - */ + /** + * Update an existing pet + */ async updatePet(requestParameters: UpdatePetRequest): Promise { await this.updatePetRaw(requestParameters); } @@ -355,9 +355,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Updates a pet in the store with form data - */ + /** + * Updates a pet in the store with form data + */ async updatePetWithForm(requestParameters: UpdatePetWithFormRequest): Promise { await this.updatePetWithFormRaw(requestParameters); } @@ -403,9 +403,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => ModelApiResponseFromJSON(jsonValue)); } - /** - * uploads an image - */ + /** + * uploads an image + */ async uploadFile(requestParameters: UploadFileRequest): Promise { const response = await this.uploadFileRaw(requestParameters); return await response.value(); diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/StoreApi.ts index 916660981657..4b645dea987e 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/StoreApi.ts @@ -59,10 +59,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete purchase order by ID - */ + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete purchase order by ID + */ async deleteOrder(requestParameters: DeleteOrderRequest): Promise { await this.deleteOrderRaw(requestParameters); } @@ -90,10 +90,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response); } - /** - * Returns a map of status codes to quantities - * Returns pet inventories by status - */ + /** + * Returns a map of status codes to quantities + * Returns pet inventories by status + */ async getInventory(): Promise<{ [key: string]: number; }> { const response = await this.getInventoryRaw(); return await response.value(); @@ -122,10 +122,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); } - /** - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Find purchase order by ID - */ + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Find purchase order by ID + */ async getOrderById(requestParameters: GetOrderByIdRequest): Promise { const response = await this.getOrderByIdRaw(requestParameters); return await response.value(); @@ -156,9 +156,9 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); } - /** - * Place an order for a pet - */ + /** + * Place an order for a pet + */ async placeOrder(requestParameters: PlaceOrderRequest): Promise { const response = await this.placeOrderRaw(requestParameters); return await response.value(); diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/UserApi.ts index 1696b600f57f..4126b817ee94 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/UserApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/UserApi.ts @@ -80,10 +80,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Create user - */ + /** + * This can only be done by the logged in user. + * Create user + */ async createUser(requestParameters: CreateUserRequest): Promise { await this.createUserRaw(requestParameters); } @@ -113,9 +113,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Creates list of users with given input array - */ + /** + * Creates list of users with given input array + */ async createUsersWithArrayInput(requestParameters: CreateUsersWithArrayInputRequest): Promise { await this.createUsersWithArrayInputRaw(requestParameters); } @@ -145,9 +145,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Creates list of users with given input array - */ + /** + * Creates list of users with given input array + */ async createUsersWithListInput(requestParameters: CreateUsersWithListInputRequest): Promise { await this.createUsersWithListInputRaw(requestParameters); } @@ -175,10 +175,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Delete user - */ + /** + * This can only be done by the logged in user. + * Delete user + */ async deleteUser(requestParameters: DeleteUserRequest): Promise { await this.deleteUserRaw(requestParameters); } @@ -205,9 +205,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue)); } - /** - * Get user by user name - */ + /** + * Get user by user name + */ async getUserByName(requestParameters: GetUserByNameRequest): Promise { const response = await this.getUserByNameRaw(requestParameters); return await response.value(); @@ -247,9 +247,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.TextApiResponse(response); } - /** - * Logs user into the system - */ + /** + * Logs user into the system + */ async loginUser(requestParameters: LoginUserRequest): Promise { const response = await this.loginUserRaw(requestParameters); return await response.value(); @@ -273,9 +273,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Logs out current logged in user session - */ + /** + * Logs out current logged in user session + */ async logoutUser(): Promise { await this.logoutUserRaw(); } @@ -310,10 +310,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Updated user - */ + /** + * This can only be done by the logged in user. + * Updated user + */ async updateUser(requestParameters: UpdateUserRequest): Promise { await this.updateUserRaw(requestParameters); } diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Category.ts index 0541f013a256..7e3076d412d2 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Category.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Category.ts @@ -47,7 +47,7 @@ export function CategoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): }; } -export function CategoryToJSON(value?: Category): any { +export function CategoryToJSON(value?: Category | null): any { if (value === undefined) { return undefined; } diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/ModelApiResponse.ts index a9f1ef2fa241..c89b98fc62be 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/ModelApiResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/ModelApiResponse.ts @@ -54,7 +54,7 @@ export function ModelApiResponseFromJSONTyped(json: any, ignoreDiscriminator: bo }; } -export function ModelApiResponseToJSON(value?: ModelApiResponse): any { +export function ModelApiResponseToJSON(value?: ModelApiResponse | null): any { if (value === undefined) { return undefined; } diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Order.ts index b9d32f387afb..da4ad33711d6 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Order.ts @@ -75,7 +75,7 @@ export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Ord }; } -export function OrderToJSON(value?: Order): any { +export function OrderToJSON(value?: Order | null): any { if (value === undefined) { return undefined; } @@ -87,7 +87,7 @@ export function OrderToJSON(value?: Order): any { 'id': value.id, 'petId': value.petId, 'quantity': value.quantity, - 'shipDate': value.shipDate === undefined ? undefined : value.shipDate.toISOString(), + 'shipDate': value.shipDate == null ? undefined : value.shipDate.toISOString(), 'status': value.status, 'complete': value.complete, }; diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Pet.ts index d0cf8f55c2c4..8f921c6b159f 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Pet.ts @@ -86,7 +86,7 @@ export function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet { }; } -export function PetToJSON(value?: Pet): any { +export function PetToJSON(value?: Pet | null): any { if (value === undefined) { return undefined; } @@ -99,7 +99,7 @@ export function PetToJSON(value?: Pet): any { 'category': CategoryToJSON(value.category), 'name': value.name, 'photoUrls': value.photoUrls, - 'tags': value.tags === undefined ? undefined : (value.tags as Array).map(TagToJSON), + 'tags': value.tags == null ? undefined : (value.tags as Array).map(TagToJSON), 'status': value.status, }; } diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Tag.ts index a095d07d0c05..5ea1fd63e818 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Tag.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Tag.ts @@ -47,7 +47,7 @@ export function TagFromJSONTyped(json: any, ignoreDiscriminator: boolean): Tag { }; } -export function TagToJSON(value?: Tag): any { +export function TagToJSON(value?: Tag | null): any { if (value === undefined) { return undefined; } diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/User.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/User.ts index 0649d0e1229c..302960bfef96 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/User.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/User.ts @@ -89,7 +89,7 @@ export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User }; } -export function UserToJSON(value?: User): any { +export function UserToJSON(value?: User | null): any { if (value === undefined) { return undefined; } diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/PetApi.ts index e43896cc2929..1fcb27ef1c5e 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/PetApi.ts @@ -98,9 +98,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Add a new pet to the store - */ + /** + * Add a new pet to the store + */ async addPet(requestParameters: AddPetRequest): Promise { await this.addPetRaw(requestParameters); } @@ -140,9 +140,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Deletes a pet - */ + /** + * Deletes a pet + */ async deletePet(requestParameters: DeletePetRequest): Promise { await this.deletePetRaw(requestParameters); } @@ -183,10 +183,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PetFromJSON)); } - /** - * Multiple status values can be provided with comma separated strings - * Finds Pets by status - */ + /** + * Multiple status values can be provided with comma separated strings + * Finds Pets by status + */ async findPetsByStatus(requestParameters: FindPetsByStatusRequest): Promise> { const response = await this.findPetsByStatusRaw(requestParameters); return await response.value(); @@ -228,10 +228,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PetFromJSON)); } - /** - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Finds Pets by tags - */ + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Finds Pets by tags + */ async findPetsByTags(requestParameters: FindPetsByTagsRequest): Promise> { const response = await this.findPetsByTagsRaw(requestParameters); return await response.value(); @@ -264,10 +264,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => PetFromJSON(jsonValue)); } - /** - * Returns a single pet - * Find pet by ID - */ + /** + * Returns a single pet + * Find pet by ID + */ async getPetById(requestParameters: GetPetByIdRequest): Promise { const response = await this.getPetByIdRaw(requestParameters); return await response.value(); @@ -307,9 +307,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Update an existing pet - */ + /** + * Update an existing pet + */ async updatePet(requestParameters: UpdatePetRequest): Promise { await this.updatePetRaw(requestParameters); } @@ -355,9 +355,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Updates a pet in the store with form data - */ + /** + * Updates a pet in the store with form data + */ async updatePetWithForm(requestParameters: UpdatePetWithFormRequest): Promise { await this.updatePetWithFormRaw(requestParameters); } @@ -403,9 +403,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => ModelApiResponseFromJSON(jsonValue)); } - /** - * uploads an image - */ + /** + * uploads an image + */ async uploadFile(requestParameters: UploadFileRequest): Promise { const response = await this.uploadFileRaw(requestParameters); return await response.value(); diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/StoreApi.ts index 916660981657..4b645dea987e 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/StoreApi.ts @@ -59,10 +59,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete purchase order by ID - */ + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete purchase order by ID + */ async deleteOrder(requestParameters: DeleteOrderRequest): Promise { await this.deleteOrderRaw(requestParameters); } @@ -90,10 +90,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response); } - /** - * Returns a map of status codes to quantities - * Returns pet inventories by status - */ + /** + * Returns a map of status codes to quantities + * Returns pet inventories by status + */ async getInventory(): Promise<{ [key: string]: number; }> { const response = await this.getInventoryRaw(); return await response.value(); @@ -122,10 +122,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); } - /** - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Find purchase order by ID - */ + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Find purchase order by ID + */ async getOrderById(requestParameters: GetOrderByIdRequest): Promise { const response = await this.getOrderByIdRaw(requestParameters); return await response.value(); @@ -156,9 +156,9 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); } - /** - * Place an order for a pet - */ + /** + * Place an order for a pet + */ async placeOrder(requestParameters: PlaceOrderRequest): Promise { const response = await this.placeOrderRaw(requestParameters); return await response.value(); diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/UserApi.ts index 1696b600f57f..4126b817ee94 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/UserApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/UserApi.ts @@ -80,10 +80,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Create user - */ + /** + * This can only be done by the logged in user. + * Create user + */ async createUser(requestParameters: CreateUserRequest): Promise { await this.createUserRaw(requestParameters); } @@ -113,9 +113,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Creates list of users with given input array - */ + /** + * Creates list of users with given input array + */ async createUsersWithArrayInput(requestParameters: CreateUsersWithArrayInputRequest): Promise { await this.createUsersWithArrayInputRaw(requestParameters); } @@ -145,9 +145,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Creates list of users with given input array - */ + /** + * Creates list of users with given input array + */ async createUsersWithListInput(requestParameters: CreateUsersWithListInputRequest): Promise { await this.createUsersWithListInputRaw(requestParameters); } @@ -175,10 +175,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Delete user - */ + /** + * This can only be done by the logged in user. + * Delete user + */ async deleteUser(requestParameters: DeleteUserRequest): Promise { await this.deleteUserRaw(requestParameters); } @@ -205,9 +205,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue)); } - /** - * Get user by user name - */ + /** + * Get user by user name + */ async getUserByName(requestParameters: GetUserByNameRequest): Promise { const response = await this.getUserByNameRaw(requestParameters); return await response.value(); @@ -247,9 +247,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.TextApiResponse(response); } - /** - * Logs user into the system - */ + /** + * Logs user into the system + */ async loginUser(requestParameters: LoginUserRequest): Promise { const response = await this.loginUserRaw(requestParameters); return await response.value(); @@ -273,9 +273,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Logs out current logged in user session - */ + /** + * Logs out current logged in user session + */ async logoutUser(): Promise { await this.logoutUserRaw(); } @@ -310,10 +310,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Updated user - */ + /** + * This can only be done by the logged in user. + * Updated user + */ async updateUser(requestParameters: UpdateUserRequest): Promise { await this.updateUserRaw(requestParameters); } diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Category.ts index 0541f013a256..7e3076d412d2 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Category.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Category.ts @@ -47,7 +47,7 @@ export function CategoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): }; } -export function CategoryToJSON(value?: Category): any { +export function CategoryToJSON(value?: Category | null): any { if (value === undefined) { return undefined; } diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/ModelApiResponse.ts index a9f1ef2fa241..c89b98fc62be 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/ModelApiResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/ModelApiResponse.ts @@ -54,7 +54,7 @@ export function ModelApiResponseFromJSONTyped(json: any, ignoreDiscriminator: bo }; } -export function ModelApiResponseToJSON(value?: ModelApiResponse): any { +export function ModelApiResponseToJSON(value?: ModelApiResponse | null): any { if (value === undefined) { return undefined; } diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Order.ts index b9d32f387afb..da4ad33711d6 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Order.ts @@ -75,7 +75,7 @@ export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Ord }; } -export function OrderToJSON(value?: Order): any { +export function OrderToJSON(value?: Order | null): any { if (value === undefined) { return undefined; } @@ -87,7 +87,7 @@ export function OrderToJSON(value?: Order): any { 'id': value.id, 'petId': value.petId, 'quantity': value.quantity, - 'shipDate': value.shipDate === undefined ? undefined : value.shipDate.toISOString(), + 'shipDate': value.shipDate == null ? undefined : value.shipDate.toISOString(), 'status': value.status, 'complete': value.complete, }; diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Pet.ts index d0cf8f55c2c4..8f921c6b159f 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Pet.ts @@ -86,7 +86,7 @@ export function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet { }; } -export function PetToJSON(value?: Pet): any { +export function PetToJSON(value?: Pet | null): any { if (value === undefined) { return undefined; } @@ -99,7 +99,7 @@ export function PetToJSON(value?: Pet): any { 'category': CategoryToJSON(value.category), 'name': value.name, 'photoUrls': value.photoUrls, - 'tags': value.tags === undefined ? undefined : (value.tags as Array).map(TagToJSON), + 'tags': value.tags == null ? undefined : (value.tags as Array).map(TagToJSON), 'status': value.status, }; } diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Tag.ts index a095d07d0c05..5ea1fd63e818 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Tag.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Tag.ts @@ -47,7 +47,7 @@ export function TagFromJSONTyped(json: any, ignoreDiscriminator: boolean): Tag { }; } -export function TagToJSON(value?: Tag): any { +export function TagToJSON(value?: Tag | null): any { if (value === undefined) { return undefined; } diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/User.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/User.ts index 0649d0e1229c..302960bfef96 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/User.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/User.ts @@ -89,7 +89,7 @@ export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User }; } -export function UserToJSON(value?: User): any { +export function UserToJSON(value?: User | null): any { if (value === undefined) { return undefined; }