From 9546218bb89a1e27d4c0fb4ac0ea03cffdfd6836 Mon Sep 17 00:00:00 2001 From: Tino Fuhrmann Date: Thu, 20 Apr 2023 17:37:42 +0200 Subject: [PATCH] Regenerated samples --- .../models/ObjectSerializer.ts | 4 +++- .../builds/with-unique-items/models/Response.ts | 5 +++-- .../builds/browser/models/ApiResponse.ts | 7 ++++--- .../builds/browser/models/Category.ts | 5 +++-- .../builds/browser/models/ObjectSerializer.ts | 4 +++- .../typescript/builds/browser/models/Order.ts | 13 +++++++------ .../typescript/builds/browser/models/Pet.ts | 13 +++++++------ .../typescript/builds/browser/models/Tag.ts | 5 +++-- .../typescript/builds/browser/models/User.ts | 17 +++++++++-------- .../builds/composed-schemas/models/Cat.ts | 5 +++-- .../builds/composed-schemas/models/CatAllOf.ts | 5 +++-- .../builds/composed-schemas/models/Dog.ts | 5 +++-- .../builds/composed-schemas/models/DogAllOf.ts | 5 +++-- .../composed-schemas/models/FilePostRequest.ts | 3 ++- .../composed-schemas/models/ObjectSerializer.ts | 4 +++- .../builds/composed-schemas/models/PetByAge.ts | 5 +++-- .../builds/composed-schemas/models/PetByType.ts | 5 +++-- .../models/PetsFilteredPatchRequest.ts | 9 +++++---- .../composed-schemas/models/PetsPatchRequest.ts | 11 +++++++---- .../builds/default/models/ApiResponse.ts | 7 ++++--- .../builds/default/models/Category.ts | 5 +++-- .../builds/default/models/ObjectSerializer.ts | 4 +++- .../typescript/builds/default/models/Order.ts | 13 +++++++------ .../typescript/builds/default/models/Pet.ts | 13 +++++++------ .../typescript/builds/default/models/Tag.ts | 5 +++-- .../typescript/builds/default/models/User.ts | 17 +++++++++-------- .../builds/deno/models/ApiResponse.ts | 7 ++++--- .../typescript/builds/deno/models/Category.ts | 5 +++-- .../builds/deno/models/ObjectSerializer.ts | 4 +++- .../typescript/builds/deno/models/Order.ts | 13 +++++++------ .../typescript/builds/deno/models/Pet.ts | 13 +++++++------ .../typescript/builds/deno/models/Tag.ts | 5 +++-- .../typescript/builds/deno/models/User.ts | 17 +++++++++-------- .../builds/inversify/models/ApiResponse.ts | 7 ++++--- .../builds/inversify/models/Category.ts | 5 +++-- .../builds/inversify/models/ObjectSerializer.ts | 4 +++- .../typescript/builds/inversify/models/Order.ts | 13 +++++++------ .../typescript/builds/inversify/models/Pet.ts | 13 +++++++------ .../typescript/builds/inversify/models/Tag.ts | 5 +++-- .../typescript/builds/inversify/models/User.ts | 17 +++++++++-------- .../builds/jquery/models/ApiResponse.ts | 7 ++++--- .../typescript/builds/jquery/models/Category.ts | 5 +++-- .../builds/jquery/models/ObjectSerializer.ts | 4 +++- .../typescript/builds/jquery/models/Order.ts | 13 +++++++------ .../typescript/builds/jquery/models/Pet.ts | 13 +++++++------ .../typescript/builds/jquery/models/Tag.ts | 5 +++-- .../typescript/builds/jquery/models/User.ts | 17 +++++++++-------- .../builds/object_params/models/ApiResponse.ts | 7 ++++--- .../builds/object_params/models/Category.ts | 5 +++-- .../object_params/models/ObjectSerializer.ts | 4 +++- .../builds/object_params/models/Order.ts | 13 +++++++------ .../builds/object_params/models/Pet.ts | 13 +++++++------ .../builds/object_params/models/Tag.ts | 5 +++-- .../builds/object_params/models/User.ts | 17 +++++++++-------- 54 files changed, 257 insertions(+), 193 deletions(-) diff --git a/samples/client/others/typescript/builds/with-unique-items/models/ObjectSerializer.ts b/samples/client/others/typescript/builds/with-unique-items/models/ObjectSerializer.ts index f10b5273214..ee369be5c2e 100644 --- a/samples/client/others/typescript/builds/with-unique-items/models/ObjectSerializer.ts +++ b/samples/client/others/typescript/builds/with-unique-items/models/ObjectSerializer.ts @@ -51,7 +51,9 @@ export class ObjectSerializer { return expectedType; // the type does not have a discriminator. use it. } else { if (data[discriminatorProperty]) { - var discriminatorType = data[discriminatorProperty]; + var discriminatorValue = data[discriminatorProperty]; + // if it has a mapping we need to map from discriminatorvalue to the actual type name + var discriminatorType = data.discriminatorTypeMap[discriminatorValue] || discriminatorValue; if(typeMap[discriminatorType]){ return discriminatorType; // use the type given in the discriminator } else { diff --git a/samples/client/others/typescript/builds/with-unique-items/models/Response.ts b/samples/client/others/typescript/builds/with-unique-items/models/Response.ts index 6a53fbd9f9d..d3dcf4059bc 100644 --- a/samples/client/others/typescript/builds/with-unique-items/models/Response.ts +++ b/samples/client/others/typescript/builds/with-unique-items/models/Response.ts @@ -22,13 +22,13 @@ export class Response { { "name": "nonUniqueArray", "baseName": "non-unique-array", - "type": "Array", + "type": "Array ", "format": "" }, { "name": "uniqueArray", "baseName": "unique-array", - "type": "Set", + "type": "Set ", "format": "" } ]; @@ -37,6 +37,7 @@ export class Response { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/browser/models/ApiResponse.ts b/samples/openapi3/client/petstore/typescript/builds/browser/models/ApiResponse.ts index f4b2d010fb7..48b5493794f 100644 --- a/samples/openapi3/client/petstore/typescript/builds/browser/models/ApiResponse.ts +++ b/samples/openapi3/client/petstore/typescript/builds/browser/models/ApiResponse.ts @@ -26,19 +26,19 @@ export class ApiResponse { { "name": "code", "baseName": "code", - "type": "number", + "type": "number ", "format": "int32" }, { "name": "type", "baseName": "type", - "type": "string", + "type": "string ", "format": "" }, { "name": "message", "baseName": "message", - "type": "string", + "type": "string ", "format": "" } ]; @@ -47,6 +47,7 @@ export class ApiResponse { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/browser/models/Category.ts b/samples/openapi3/client/petstore/typescript/builds/browser/models/Category.ts index 5d63fc87a99..de2e51eec81 100644 --- a/samples/openapi3/client/petstore/typescript/builds/browser/models/Category.ts +++ b/samples/openapi3/client/petstore/typescript/builds/browser/models/Category.ts @@ -25,13 +25,13 @@ export class Category { { "name": "id", "baseName": "id", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "name", "baseName": "name", - "type": "string", + "type": "string ", "format": "" } ]; @@ -40,6 +40,7 @@ export class Category { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/browser/models/ObjectSerializer.ts b/samples/openapi3/client/petstore/typescript/builds/browser/models/ObjectSerializer.ts index dfbb605553b..5ab4695bcd5 100644 --- a/samples/openapi3/client/petstore/typescript/builds/browser/models/ObjectSerializer.ts +++ b/samples/openapi3/client/petstore/typescript/builds/browser/models/ObjectSerializer.ts @@ -68,7 +68,9 @@ export class ObjectSerializer { return expectedType; // the type does not have a discriminator. use it. } else { if (data[discriminatorProperty]) { - var discriminatorType = data[discriminatorProperty]; + var discriminatorValue = data[discriminatorProperty]; + // if it has a mapping we need to map from discriminatorvalue to the actual type name + var discriminatorType = data.discriminatorTypeMap[discriminatorValue] || discriminatorValue; if(typeMap[discriminatorType]){ return discriminatorType; // use the type given in the discriminator } else { diff --git a/samples/openapi3/client/petstore/typescript/builds/browser/models/Order.ts b/samples/openapi3/client/petstore/typescript/builds/browser/models/Order.ts index a2f84555ff1..bdde3c21f57 100644 --- a/samples/openapi3/client/petstore/typescript/builds/browser/models/Order.ts +++ b/samples/openapi3/client/petstore/typescript/builds/browser/models/Order.ts @@ -32,37 +32,37 @@ export class Order { { "name": "id", "baseName": "id", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "petId", "baseName": "petId", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "quantity", "baseName": "quantity", - "type": "number", + "type": "number ", "format": "int32" }, { "name": "shipDate", "baseName": "shipDate", - "type": "Date", + "type": "Date ", "format": "date-time" }, { "name": "status", "baseName": "status", - "type": "OrderStatusEnum", + "type": "OrderStatusEnum ", "format": "" }, { "name": "complete", "baseName": "complete", - "type": "boolean", + "type": "boolean ", "format": "" } ]; @@ -71,6 +71,7 @@ export class Order { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/browser/models/Pet.ts b/samples/openapi3/client/petstore/typescript/builds/browser/models/Pet.ts index b3a7ddb9f71..2adbccd60c5 100644 --- a/samples/openapi3/client/petstore/typescript/builds/browser/models/Pet.ts +++ b/samples/openapi3/client/petstore/typescript/builds/browser/models/Pet.ts @@ -34,37 +34,37 @@ export class Pet { { "name": "id", "baseName": "id", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "category", "baseName": "category", - "type": "Category", + "type": "Category ", "format": "" }, { "name": "name", "baseName": "name", - "type": "string", + "type": "string ", "format": "" }, { "name": "photoUrls", "baseName": "photoUrls", - "type": "Array", + "type": "Array ", "format": "" }, { "name": "tags", "baseName": "tags", - "type": "Array", + "type": "Array ", "format": "" }, { "name": "status", "baseName": "status", - "type": "PetStatusEnum", + "type": "PetStatusEnum ", "format": "" } ]; @@ -73,6 +73,7 @@ export class Pet { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/browser/models/Tag.ts b/samples/openapi3/client/petstore/typescript/builds/browser/models/Tag.ts index 8c4f6967b9a..22efbf3cbf0 100644 --- a/samples/openapi3/client/petstore/typescript/builds/browser/models/Tag.ts +++ b/samples/openapi3/client/petstore/typescript/builds/browser/models/Tag.ts @@ -25,13 +25,13 @@ export class Tag { { "name": "id", "baseName": "id", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "name", "baseName": "name", - "type": "string", + "type": "string ", "format": "" } ]; @@ -40,6 +40,7 @@ export class Tag { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/browser/models/User.ts b/samples/openapi3/client/petstore/typescript/builds/browser/models/User.ts index 68528ad3c9e..58fd46589ad 100644 --- a/samples/openapi3/client/petstore/typescript/builds/browser/models/User.ts +++ b/samples/openapi3/client/petstore/typescript/builds/browser/models/User.ts @@ -34,49 +34,49 @@ export class User { { "name": "id", "baseName": "id", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "username", "baseName": "username", - "type": "string", + "type": "string ", "format": "" }, { "name": "firstName", "baseName": "firstName", - "type": "string", + "type": "string ", "format": "" }, { "name": "lastName", "baseName": "lastName", - "type": "string", + "type": "string ", "format": "" }, { "name": "email", "baseName": "email", - "type": "string", + "type": "string ", "format": "" }, { "name": "password", "baseName": "password", - "type": "string", + "type": "string ", "format": "" }, { "name": "phone", "baseName": "phone", - "type": "string", + "type": "string ", "format": "" }, { "name": "userStatus", "baseName": "userStatus", - "type": "number", + "type": "number ", "format": "int32" } ]; @@ -85,6 +85,7 @@ export class User { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/Cat.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/Cat.ts index 2790b653b55..ab23c38acd7 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/Cat.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/Cat.ts @@ -22,13 +22,13 @@ export class Cat { { "name": "hunts", "baseName": "hunts", - "type": "boolean", + "type": "boolean ", "format": "" }, { "name": "age", "baseName": "age", - "type": "number", + "type": "number ", "format": "" } ]; @@ -37,6 +37,7 @@ export class Cat { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/CatAllOf.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/CatAllOf.ts index 049c937cadb..87fd2a8ff12 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/CatAllOf.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/CatAllOf.ts @@ -22,13 +22,13 @@ export class CatAllOf { { "name": "hunts", "baseName": "hunts", - "type": "boolean", + "type": "boolean ", "format": "" }, { "name": "age", "baseName": "age", - "type": "number", + "type": "number ", "format": "" } ]; @@ -37,6 +37,7 @@ export class CatAllOf { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/Dog.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/Dog.ts index dd2380572f6..ae0b4b5581f 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/Dog.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/Dog.ts @@ -22,13 +22,13 @@ export class Dog { { "name": "bark", "baseName": "bark", - "type": "boolean", + "type": "boolean ", "format": "" }, { "name": "breed", "baseName": "breed", - "type": "DogBreedEnum", + "type": "DogBreedEnum ", "format": "" } ]; @@ -37,6 +37,7 @@ export class Dog { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/DogAllOf.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/DogAllOf.ts index 5bc68d78889..def2cbf5aaf 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/DogAllOf.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/DogAllOf.ts @@ -22,13 +22,13 @@ export class DogAllOf { { "name": "bark", "baseName": "bark", - "type": "boolean", + "type": "boolean ", "format": "" }, { "name": "breed", "baseName": "breed", - "type": "DogAllOfBreedEnum", + "type": "DogAllOfBreedEnum ", "format": "" } ]; @@ -37,6 +37,7 @@ export class DogAllOf { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/FilePostRequest.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/FilePostRequest.ts index ddd7a052d56..6bf1e6bbfc5 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/FilePostRequest.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/FilePostRequest.ts @@ -21,7 +21,7 @@ export class FilePostRequest { { "name": "file", "baseName": "file", - "type": "any", + "type": "any ", "format": "" } ]; @@ -30,6 +30,7 @@ export class FilePostRequest { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/ObjectSerializer.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/ObjectSerializer.ts index e726b1bbdc3..54af3ae7ea5 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/ObjectSerializer.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/ObjectSerializer.ts @@ -80,7 +80,9 @@ export class ObjectSerializer { return expectedType; // the type does not have a discriminator. use it. } else { if (data[discriminatorProperty]) { - var discriminatorType = data[discriminatorProperty]; + var discriminatorValue = data[discriminatorProperty]; + // if it has a mapping we need to map from discriminatorvalue to the actual type name + var discriminatorType = data.discriminatorTypeMap[discriminatorValue] || discriminatorValue; if(typeMap[discriminatorType]){ return discriminatorType; // use the type given in the discriminator } else { diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/PetByAge.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/PetByAge.ts index 6c7e3c20f0f..5f5d4468014 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/PetByAge.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/PetByAge.ts @@ -22,13 +22,13 @@ export class PetByAge { { "name": "age", "baseName": "age", - "type": "number", + "type": "number ", "format": "" }, { "name": "nickname", "baseName": "nickname", - "type": "string", + "type": "string ", "format": "" } ]; @@ -37,6 +37,7 @@ export class PetByAge { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/PetByType.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/PetByType.ts index aef39d9d601..72d6de4445d 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/PetByType.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/PetByType.ts @@ -22,13 +22,13 @@ export class PetByType { { "name": "petType", "baseName": "pet_type", - "type": "PetByTypePetTypeEnum", + "type": "PetByTypePetTypeEnum ", "format": "" }, { "name": "hunts", "baseName": "hunts", - "type": "boolean", + "type": "boolean ", "format": "" } ]; @@ -37,6 +37,7 @@ export class PetByType { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/PetsFilteredPatchRequest.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/PetsFilteredPatchRequest.ts index 12ae18d6b74..38017bcb5d4 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/PetsFilteredPatchRequest.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/PetsFilteredPatchRequest.ts @@ -26,25 +26,25 @@ export class PetsFilteredPatchRequest { { "name": "age", "baseName": "age", - "type": "number", + "type": "number ", "format": "" }, { "name": "nickname", "baseName": "nickname", - "type": "string", + "type": "string ", "format": "" }, { "name": "petType", "baseName": "pet_type", - "type": "PetsFilteredPatchRequestPetTypeEnum", + "type": "PetsFilteredPatchRequestPetTypeEnum ", "format": "" }, { "name": "hunts", "baseName": "hunts", - "type": "boolean", + "type": "boolean ", "format": "" } ]; @@ -53,6 +53,7 @@ export class PetsFilteredPatchRequest { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/PetsPatchRequest.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/PetsPatchRequest.ts index c68b69a3296..16c1f35681f 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/PetsPatchRequest.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/PetsPatchRequest.ts @@ -21,30 +21,32 @@ export class PetsPatchRequest { 'breed'?: PetsPatchRequestBreedEnum; static readonly discriminator: string | undefined = "petType"; + static readonly discriminatorTypeMap = { + } static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "hunts", "baseName": "hunts", - "type": "boolean", + "type": "boolean ", "format": "" }, { "name": "age", "baseName": "age", - "type": "number", + "type": "number ", "format": "" }, { "name": "bark", "baseName": "bark", - "type": "boolean", + "type": "boolean ", "format": "" }, { "name": "breed", "baseName": "breed", - "type": "PetsPatchRequestBreedEnum", + "type": "PetsPatchRequestBreedEnum ", "format": "" } ]; @@ -53,6 +55,7 @@ export class PetsPatchRequest { } public constructor() { + this.petType = "PetsPatchRequest"; } } diff --git a/samples/openapi3/client/petstore/typescript/builds/default/models/ApiResponse.ts b/samples/openapi3/client/petstore/typescript/builds/default/models/ApiResponse.ts index f4b2d010fb7..48b5493794f 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/models/ApiResponse.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/models/ApiResponse.ts @@ -26,19 +26,19 @@ export class ApiResponse { { "name": "code", "baseName": "code", - "type": "number", + "type": "number ", "format": "int32" }, { "name": "type", "baseName": "type", - "type": "string", + "type": "string ", "format": "" }, { "name": "message", "baseName": "message", - "type": "string", + "type": "string ", "format": "" } ]; @@ -47,6 +47,7 @@ export class ApiResponse { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/default/models/Category.ts b/samples/openapi3/client/petstore/typescript/builds/default/models/Category.ts index 5d63fc87a99..de2e51eec81 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/models/Category.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/models/Category.ts @@ -25,13 +25,13 @@ export class Category { { "name": "id", "baseName": "id", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "name", "baseName": "name", - "type": "string", + "type": "string ", "format": "" } ]; @@ -40,6 +40,7 @@ export class Category { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/default/models/ObjectSerializer.ts b/samples/openapi3/client/petstore/typescript/builds/default/models/ObjectSerializer.ts index dfbb605553b..5ab4695bcd5 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/models/ObjectSerializer.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/models/ObjectSerializer.ts @@ -68,7 +68,9 @@ export class ObjectSerializer { return expectedType; // the type does not have a discriminator. use it. } else { if (data[discriminatorProperty]) { - var discriminatorType = data[discriminatorProperty]; + var discriminatorValue = data[discriminatorProperty]; + // if it has a mapping we need to map from discriminatorvalue to the actual type name + var discriminatorType = data.discriminatorTypeMap[discriminatorValue] || discriminatorValue; if(typeMap[discriminatorType]){ return discriminatorType; // use the type given in the discriminator } else { diff --git a/samples/openapi3/client/petstore/typescript/builds/default/models/Order.ts b/samples/openapi3/client/petstore/typescript/builds/default/models/Order.ts index a2f84555ff1..bdde3c21f57 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/models/Order.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/models/Order.ts @@ -32,37 +32,37 @@ export class Order { { "name": "id", "baseName": "id", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "petId", "baseName": "petId", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "quantity", "baseName": "quantity", - "type": "number", + "type": "number ", "format": "int32" }, { "name": "shipDate", "baseName": "shipDate", - "type": "Date", + "type": "Date ", "format": "date-time" }, { "name": "status", "baseName": "status", - "type": "OrderStatusEnum", + "type": "OrderStatusEnum ", "format": "" }, { "name": "complete", "baseName": "complete", - "type": "boolean", + "type": "boolean ", "format": "" } ]; @@ -71,6 +71,7 @@ export class Order { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/default/models/Pet.ts b/samples/openapi3/client/petstore/typescript/builds/default/models/Pet.ts index b3a7ddb9f71..2adbccd60c5 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/models/Pet.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/models/Pet.ts @@ -34,37 +34,37 @@ export class Pet { { "name": "id", "baseName": "id", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "category", "baseName": "category", - "type": "Category", + "type": "Category ", "format": "" }, { "name": "name", "baseName": "name", - "type": "string", + "type": "string ", "format": "" }, { "name": "photoUrls", "baseName": "photoUrls", - "type": "Array", + "type": "Array ", "format": "" }, { "name": "tags", "baseName": "tags", - "type": "Array", + "type": "Array ", "format": "" }, { "name": "status", "baseName": "status", - "type": "PetStatusEnum", + "type": "PetStatusEnum ", "format": "" } ]; @@ -73,6 +73,7 @@ export class Pet { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/default/models/Tag.ts b/samples/openapi3/client/petstore/typescript/builds/default/models/Tag.ts index 8c4f6967b9a..22efbf3cbf0 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/models/Tag.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/models/Tag.ts @@ -25,13 +25,13 @@ export class Tag { { "name": "id", "baseName": "id", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "name", "baseName": "name", - "type": "string", + "type": "string ", "format": "" } ]; @@ -40,6 +40,7 @@ export class Tag { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/default/models/User.ts b/samples/openapi3/client/petstore/typescript/builds/default/models/User.ts index 68528ad3c9e..58fd46589ad 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/models/User.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/models/User.ts @@ -34,49 +34,49 @@ export class User { { "name": "id", "baseName": "id", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "username", "baseName": "username", - "type": "string", + "type": "string ", "format": "" }, { "name": "firstName", "baseName": "firstName", - "type": "string", + "type": "string ", "format": "" }, { "name": "lastName", "baseName": "lastName", - "type": "string", + "type": "string ", "format": "" }, { "name": "email", "baseName": "email", - "type": "string", + "type": "string ", "format": "" }, { "name": "password", "baseName": "password", - "type": "string", + "type": "string ", "format": "" }, { "name": "phone", "baseName": "phone", - "type": "string", + "type": "string ", "format": "" }, { "name": "userStatus", "baseName": "userStatus", - "type": "number", + "type": "number ", "format": "int32" } ]; @@ -85,6 +85,7 @@ export class User { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/models/ApiResponse.ts b/samples/openapi3/client/petstore/typescript/builds/deno/models/ApiResponse.ts index b5cfa4948a0..c0f46652e69 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/models/ApiResponse.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/models/ApiResponse.ts @@ -26,19 +26,19 @@ export class ApiResponse { { "name": "code", "baseName": "code", - "type": "number", + "type": "number ", "format": "int32" }, { "name": "type", "baseName": "type", - "type": "string", + "type": "string ", "format": "" }, { "name": "message", "baseName": "message", - "type": "string", + "type": "string ", "format": "" } ]; @@ -47,6 +47,7 @@ export class ApiResponse { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/models/Category.ts b/samples/openapi3/client/petstore/typescript/builds/deno/models/Category.ts index 9c1bdd23614..99022f53115 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/models/Category.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/models/Category.ts @@ -25,13 +25,13 @@ export class Category { { "name": "id", "baseName": "id", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "name", "baseName": "name", - "type": "string", + "type": "string ", "format": "" } ]; @@ -40,6 +40,7 @@ export class Category { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/models/ObjectSerializer.ts b/samples/openapi3/client/petstore/typescript/builds/deno/models/ObjectSerializer.ts index 0da0325edc8..8aebaab0575 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/models/ObjectSerializer.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/models/ObjectSerializer.ts @@ -68,7 +68,9 @@ export class ObjectSerializer { return expectedType; // the type does not have a discriminator. use it. } else { if (data[discriminatorProperty]) { - var discriminatorType = data[discriminatorProperty]; + var discriminatorValue = data[discriminatorProperty]; + // if it has a mapping we need to map from discriminatorvalue to the actual type name + var discriminatorType = data.discriminatorTypeMap[discriminatorValue] || discriminatorValue; if(typeMap[discriminatorType]){ return discriminatorType; // use the type given in the discriminator } else { diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/models/Order.ts b/samples/openapi3/client/petstore/typescript/builds/deno/models/Order.ts index 644657299f3..52a9f499152 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/models/Order.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/models/Order.ts @@ -32,37 +32,37 @@ export class Order { { "name": "id", "baseName": "id", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "petId", "baseName": "petId", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "quantity", "baseName": "quantity", - "type": "number", + "type": "number ", "format": "int32" }, { "name": "shipDate", "baseName": "shipDate", - "type": "Date", + "type": "Date ", "format": "date-time" }, { "name": "status", "baseName": "status", - "type": "OrderStatusEnum", + "type": "OrderStatusEnum ", "format": "" }, { "name": "complete", "baseName": "complete", - "type": "boolean", + "type": "boolean ", "format": "" } ]; @@ -71,6 +71,7 @@ export class Order { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/models/Pet.ts b/samples/openapi3/client/petstore/typescript/builds/deno/models/Pet.ts index 229681feacd..32b5d5a864e 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/models/Pet.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/models/Pet.ts @@ -34,37 +34,37 @@ export class Pet { { "name": "id", "baseName": "id", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "category", "baseName": "category", - "type": "Category", + "type": "Category ", "format": "" }, { "name": "name", "baseName": "name", - "type": "string", + "type": "string ", "format": "" }, { "name": "photoUrls", "baseName": "photoUrls", - "type": "Array", + "type": "Array ", "format": "" }, { "name": "tags", "baseName": "tags", - "type": "Array", + "type": "Array ", "format": "" }, { "name": "status", "baseName": "status", - "type": "PetStatusEnum", + "type": "PetStatusEnum ", "format": "" } ]; @@ -73,6 +73,7 @@ export class Pet { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/models/Tag.ts b/samples/openapi3/client/petstore/typescript/builds/deno/models/Tag.ts index dc2c98212c3..d0b3b750bbf 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/models/Tag.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/models/Tag.ts @@ -25,13 +25,13 @@ export class Tag { { "name": "id", "baseName": "id", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "name", "baseName": "name", - "type": "string", + "type": "string ", "format": "" } ]; @@ -40,6 +40,7 @@ export class Tag { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/models/User.ts b/samples/openapi3/client/petstore/typescript/builds/deno/models/User.ts index 76c6a9ae869..3f6017bfd3d 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/models/User.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/models/User.ts @@ -34,49 +34,49 @@ export class User { { "name": "id", "baseName": "id", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "username", "baseName": "username", - "type": "string", + "type": "string ", "format": "" }, { "name": "firstName", "baseName": "firstName", - "type": "string", + "type": "string ", "format": "" }, { "name": "lastName", "baseName": "lastName", - "type": "string", + "type": "string ", "format": "" }, { "name": "email", "baseName": "email", - "type": "string", + "type": "string ", "format": "" }, { "name": "password", "baseName": "password", - "type": "string", + "type": "string ", "format": "" }, { "name": "phone", "baseName": "phone", - "type": "string", + "type": "string ", "format": "" }, { "name": "userStatus", "baseName": "userStatus", - "type": "number", + "type": "number ", "format": "int32" } ]; @@ -85,6 +85,7 @@ export class User { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/models/ApiResponse.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/models/ApiResponse.ts index f4b2d010fb7..48b5493794f 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/models/ApiResponse.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/models/ApiResponse.ts @@ -26,19 +26,19 @@ export class ApiResponse { { "name": "code", "baseName": "code", - "type": "number", + "type": "number ", "format": "int32" }, { "name": "type", "baseName": "type", - "type": "string", + "type": "string ", "format": "" }, { "name": "message", "baseName": "message", - "type": "string", + "type": "string ", "format": "" } ]; @@ -47,6 +47,7 @@ export class ApiResponse { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/models/Category.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/models/Category.ts index 5d63fc87a99..de2e51eec81 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/models/Category.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/models/Category.ts @@ -25,13 +25,13 @@ export class Category { { "name": "id", "baseName": "id", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "name", "baseName": "name", - "type": "string", + "type": "string ", "format": "" } ]; @@ -40,6 +40,7 @@ export class Category { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/models/ObjectSerializer.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/models/ObjectSerializer.ts index dfbb605553b..5ab4695bcd5 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/models/ObjectSerializer.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/models/ObjectSerializer.ts @@ -68,7 +68,9 @@ export class ObjectSerializer { return expectedType; // the type does not have a discriminator. use it. } else { if (data[discriminatorProperty]) { - var discriminatorType = data[discriminatorProperty]; + var discriminatorValue = data[discriminatorProperty]; + // if it has a mapping we need to map from discriminatorvalue to the actual type name + var discriminatorType = data.discriminatorTypeMap[discriminatorValue] || discriminatorValue; if(typeMap[discriminatorType]){ return discriminatorType; // use the type given in the discriminator } else { diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/models/Order.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/models/Order.ts index a2f84555ff1..bdde3c21f57 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/models/Order.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/models/Order.ts @@ -32,37 +32,37 @@ export class Order { { "name": "id", "baseName": "id", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "petId", "baseName": "petId", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "quantity", "baseName": "quantity", - "type": "number", + "type": "number ", "format": "int32" }, { "name": "shipDate", "baseName": "shipDate", - "type": "Date", + "type": "Date ", "format": "date-time" }, { "name": "status", "baseName": "status", - "type": "OrderStatusEnum", + "type": "OrderStatusEnum ", "format": "" }, { "name": "complete", "baseName": "complete", - "type": "boolean", + "type": "boolean ", "format": "" } ]; @@ -71,6 +71,7 @@ export class Order { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/models/Pet.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/models/Pet.ts index b3a7ddb9f71..2adbccd60c5 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/models/Pet.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/models/Pet.ts @@ -34,37 +34,37 @@ export class Pet { { "name": "id", "baseName": "id", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "category", "baseName": "category", - "type": "Category", + "type": "Category ", "format": "" }, { "name": "name", "baseName": "name", - "type": "string", + "type": "string ", "format": "" }, { "name": "photoUrls", "baseName": "photoUrls", - "type": "Array", + "type": "Array ", "format": "" }, { "name": "tags", "baseName": "tags", - "type": "Array", + "type": "Array ", "format": "" }, { "name": "status", "baseName": "status", - "type": "PetStatusEnum", + "type": "PetStatusEnum ", "format": "" } ]; @@ -73,6 +73,7 @@ export class Pet { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/models/Tag.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/models/Tag.ts index 8c4f6967b9a..22efbf3cbf0 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/models/Tag.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/models/Tag.ts @@ -25,13 +25,13 @@ export class Tag { { "name": "id", "baseName": "id", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "name", "baseName": "name", - "type": "string", + "type": "string ", "format": "" } ]; @@ -40,6 +40,7 @@ export class Tag { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/models/User.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/models/User.ts index 68528ad3c9e..58fd46589ad 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/models/User.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/models/User.ts @@ -34,49 +34,49 @@ export class User { { "name": "id", "baseName": "id", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "username", "baseName": "username", - "type": "string", + "type": "string ", "format": "" }, { "name": "firstName", "baseName": "firstName", - "type": "string", + "type": "string ", "format": "" }, { "name": "lastName", "baseName": "lastName", - "type": "string", + "type": "string ", "format": "" }, { "name": "email", "baseName": "email", - "type": "string", + "type": "string ", "format": "" }, { "name": "password", "baseName": "password", - "type": "string", + "type": "string ", "format": "" }, { "name": "phone", "baseName": "phone", - "type": "string", + "type": "string ", "format": "" }, { "name": "userStatus", "baseName": "userStatus", - "type": "number", + "type": "number ", "format": "int32" } ]; @@ -85,6 +85,7 @@ export class User { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/models/ApiResponse.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/models/ApiResponse.ts index f4b2d010fb7..48b5493794f 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/models/ApiResponse.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/models/ApiResponse.ts @@ -26,19 +26,19 @@ export class ApiResponse { { "name": "code", "baseName": "code", - "type": "number", + "type": "number ", "format": "int32" }, { "name": "type", "baseName": "type", - "type": "string", + "type": "string ", "format": "" }, { "name": "message", "baseName": "message", - "type": "string", + "type": "string ", "format": "" } ]; @@ -47,6 +47,7 @@ export class ApiResponse { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/models/Category.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/models/Category.ts index 5d63fc87a99..de2e51eec81 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/models/Category.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/models/Category.ts @@ -25,13 +25,13 @@ export class Category { { "name": "id", "baseName": "id", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "name", "baseName": "name", - "type": "string", + "type": "string ", "format": "" } ]; @@ -40,6 +40,7 @@ export class Category { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/models/ObjectSerializer.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/models/ObjectSerializer.ts index dfbb605553b..5ab4695bcd5 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/models/ObjectSerializer.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/models/ObjectSerializer.ts @@ -68,7 +68,9 @@ export class ObjectSerializer { return expectedType; // the type does not have a discriminator. use it. } else { if (data[discriminatorProperty]) { - var discriminatorType = data[discriminatorProperty]; + var discriminatorValue = data[discriminatorProperty]; + // if it has a mapping we need to map from discriminatorvalue to the actual type name + var discriminatorType = data.discriminatorTypeMap[discriminatorValue] || discriminatorValue; if(typeMap[discriminatorType]){ return discriminatorType; // use the type given in the discriminator } else { diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/models/Order.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/models/Order.ts index a2f84555ff1..bdde3c21f57 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/models/Order.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/models/Order.ts @@ -32,37 +32,37 @@ export class Order { { "name": "id", "baseName": "id", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "petId", "baseName": "petId", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "quantity", "baseName": "quantity", - "type": "number", + "type": "number ", "format": "int32" }, { "name": "shipDate", "baseName": "shipDate", - "type": "Date", + "type": "Date ", "format": "date-time" }, { "name": "status", "baseName": "status", - "type": "OrderStatusEnum", + "type": "OrderStatusEnum ", "format": "" }, { "name": "complete", "baseName": "complete", - "type": "boolean", + "type": "boolean ", "format": "" } ]; @@ -71,6 +71,7 @@ export class Order { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/models/Pet.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/models/Pet.ts index b3a7ddb9f71..2adbccd60c5 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/models/Pet.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/models/Pet.ts @@ -34,37 +34,37 @@ export class Pet { { "name": "id", "baseName": "id", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "category", "baseName": "category", - "type": "Category", + "type": "Category ", "format": "" }, { "name": "name", "baseName": "name", - "type": "string", + "type": "string ", "format": "" }, { "name": "photoUrls", "baseName": "photoUrls", - "type": "Array", + "type": "Array ", "format": "" }, { "name": "tags", "baseName": "tags", - "type": "Array", + "type": "Array ", "format": "" }, { "name": "status", "baseName": "status", - "type": "PetStatusEnum", + "type": "PetStatusEnum ", "format": "" } ]; @@ -73,6 +73,7 @@ export class Pet { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/models/Tag.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/models/Tag.ts index 8c4f6967b9a..22efbf3cbf0 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/models/Tag.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/models/Tag.ts @@ -25,13 +25,13 @@ export class Tag { { "name": "id", "baseName": "id", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "name", "baseName": "name", - "type": "string", + "type": "string ", "format": "" } ]; @@ -40,6 +40,7 @@ export class Tag { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/models/User.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/models/User.ts index 68528ad3c9e..58fd46589ad 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/models/User.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/models/User.ts @@ -34,49 +34,49 @@ export class User { { "name": "id", "baseName": "id", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "username", "baseName": "username", - "type": "string", + "type": "string ", "format": "" }, { "name": "firstName", "baseName": "firstName", - "type": "string", + "type": "string ", "format": "" }, { "name": "lastName", "baseName": "lastName", - "type": "string", + "type": "string ", "format": "" }, { "name": "email", "baseName": "email", - "type": "string", + "type": "string ", "format": "" }, { "name": "password", "baseName": "password", - "type": "string", + "type": "string ", "format": "" }, { "name": "phone", "baseName": "phone", - "type": "string", + "type": "string ", "format": "" }, { "name": "userStatus", "baseName": "userStatus", - "type": "number", + "type": "number ", "format": "int32" } ]; @@ -85,6 +85,7 @@ export class User { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/models/ApiResponse.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/models/ApiResponse.ts index f4b2d010fb7..48b5493794f 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/models/ApiResponse.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/models/ApiResponse.ts @@ -26,19 +26,19 @@ export class ApiResponse { { "name": "code", "baseName": "code", - "type": "number", + "type": "number ", "format": "int32" }, { "name": "type", "baseName": "type", - "type": "string", + "type": "string ", "format": "" }, { "name": "message", "baseName": "message", - "type": "string", + "type": "string ", "format": "" } ]; @@ -47,6 +47,7 @@ export class ApiResponse { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/models/Category.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/models/Category.ts index 5d63fc87a99..de2e51eec81 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/models/Category.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/models/Category.ts @@ -25,13 +25,13 @@ export class Category { { "name": "id", "baseName": "id", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "name", "baseName": "name", - "type": "string", + "type": "string ", "format": "" } ]; @@ -40,6 +40,7 @@ export class Category { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/models/ObjectSerializer.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/models/ObjectSerializer.ts index dfbb605553b..5ab4695bcd5 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/models/ObjectSerializer.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/models/ObjectSerializer.ts @@ -68,7 +68,9 @@ export class ObjectSerializer { return expectedType; // the type does not have a discriminator. use it. } else { if (data[discriminatorProperty]) { - var discriminatorType = data[discriminatorProperty]; + var discriminatorValue = data[discriminatorProperty]; + // if it has a mapping we need to map from discriminatorvalue to the actual type name + var discriminatorType = data.discriminatorTypeMap[discriminatorValue] || discriminatorValue; if(typeMap[discriminatorType]){ return discriminatorType; // use the type given in the discriminator } else { diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/models/Order.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/models/Order.ts index a2f84555ff1..bdde3c21f57 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/models/Order.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/models/Order.ts @@ -32,37 +32,37 @@ export class Order { { "name": "id", "baseName": "id", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "petId", "baseName": "petId", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "quantity", "baseName": "quantity", - "type": "number", + "type": "number ", "format": "int32" }, { "name": "shipDate", "baseName": "shipDate", - "type": "Date", + "type": "Date ", "format": "date-time" }, { "name": "status", "baseName": "status", - "type": "OrderStatusEnum", + "type": "OrderStatusEnum ", "format": "" }, { "name": "complete", "baseName": "complete", - "type": "boolean", + "type": "boolean ", "format": "" } ]; @@ -71,6 +71,7 @@ export class Order { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/models/Pet.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/models/Pet.ts index b3a7ddb9f71..2adbccd60c5 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/models/Pet.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/models/Pet.ts @@ -34,37 +34,37 @@ export class Pet { { "name": "id", "baseName": "id", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "category", "baseName": "category", - "type": "Category", + "type": "Category ", "format": "" }, { "name": "name", "baseName": "name", - "type": "string", + "type": "string ", "format": "" }, { "name": "photoUrls", "baseName": "photoUrls", - "type": "Array", + "type": "Array ", "format": "" }, { "name": "tags", "baseName": "tags", - "type": "Array", + "type": "Array ", "format": "" }, { "name": "status", "baseName": "status", - "type": "PetStatusEnum", + "type": "PetStatusEnum ", "format": "" } ]; @@ -73,6 +73,7 @@ export class Pet { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/models/Tag.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/models/Tag.ts index 8c4f6967b9a..22efbf3cbf0 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/models/Tag.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/models/Tag.ts @@ -25,13 +25,13 @@ export class Tag { { "name": "id", "baseName": "id", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "name", "baseName": "name", - "type": "string", + "type": "string ", "format": "" } ]; @@ -40,6 +40,7 @@ export class Tag { } public constructor() { + } } diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/models/User.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/models/User.ts index 68528ad3c9e..58fd46589ad 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/models/User.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/models/User.ts @@ -34,49 +34,49 @@ export class User { { "name": "id", "baseName": "id", - "type": "number", + "type": "number ", "format": "int64" }, { "name": "username", "baseName": "username", - "type": "string", + "type": "string ", "format": "" }, { "name": "firstName", "baseName": "firstName", - "type": "string", + "type": "string ", "format": "" }, { "name": "lastName", "baseName": "lastName", - "type": "string", + "type": "string ", "format": "" }, { "name": "email", "baseName": "email", - "type": "string", + "type": "string ", "format": "" }, { "name": "password", "baseName": "password", - "type": "string", + "type": "string ", "format": "" }, { "name": "phone", "baseName": "phone", - "type": "string", + "type": "string ", "format": "" }, { "name": "userStatus", "baseName": "userStatus", - "type": "number", + "type": "number ", "format": "int32" } ]; @@ -85,6 +85,7 @@ export class User { } public constructor() { + } }