Regenerated samples

This commit is contained in:
Tino Fuhrmann
2023-04-20 17:37:42 +02:00
parent cd79f5eff9
commit 9546218bb8
54 changed files with 257 additions and 193 deletions

View File

@@ -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 {

View File

@@ -22,13 +22,13 @@ export class Response {
{
"name": "nonUniqueArray",
"baseName": "non-unique-array",
"type": "Array<string>",
"type": "Array<string> ",
"format": ""
},
{
"name": "uniqueArray",
"baseName": "unique-array",
"type": "Set<string>",
"type": "Set<string> ",
"format": ""
} ];
@@ -37,6 +37,7 @@ export class Response {
}
public constructor() {
}
}

View File

@@ -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() {
}
}

View File

@@ -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() {
}
}

View File

@@ -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 {

View File

@@ -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() {
}
}

View File

@@ -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<string>",
"type": "Array<string> ",
"format": ""
},
{
"name": "tags",
"baseName": "tags",
"type": "Array<Tag>",
"type": "Array<Tag> ",
"format": ""
},
{
"name": "status",
"baseName": "status",
"type": "PetStatusEnum",
"type": "PetStatusEnum ",
"format": ""
} ];
@@ -73,6 +73,7 @@ export class Pet {
}
public constructor() {
}
}

View File

@@ -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() {
}
}

View File

@@ -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() {
}
}

View File

@@ -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() {
}
}

View File

@@ -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() {
}
}

View File

@@ -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() {
}
}

View File

@@ -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() {
}
}

View File

@@ -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() {
}
}

View File

@@ -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 {

View File

@@ -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() {
}
}

View File

@@ -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() {
}
}

View File

@@ -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() {
}
}

View File

@@ -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";
}
}

View File

@@ -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() {
}
}

View File

@@ -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() {
}
}

View File

@@ -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 {

View File

@@ -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() {
}
}

View File

@@ -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<string>",
"type": "Array<string> ",
"format": ""
},
{
"name": "tags",
"baseName": "tags",
"type": "Array<Tag>",
"type": "Array<Tag> ",
"format": ""
},
{
"name": "status",
"baseName": "status",
"type": "PetStatusEnum",
"type": "PetStatusEnum ",
"format": ""
} ];
@@ -73,6 +73,7 @@ export class Pet {
}
public constructor() {
}
}

View File

@@ -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() {
}
}

View File

@@ -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() {
}
}

View File

@@ -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() {
}
}

View File

@@ -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() {
}
}

View File

@@ -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 {

View File

@@ -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() {
}
}

View File

@@ -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<string>",
"type": "Array<string> ",
"format": ""
},
{
"name": "tags",
"baseName": "tags",
"type": "Array<Tag>",
"type": "Array<Tag> ",
"format": ""
},
{
"name": "status",
"baseName": "status",
"type": "PetStatusEnum",
"type": "PetStatusEnum ",
"format": ""
} ];
@@ -73,6 +73,7 @@ export class Pet {
}
public constructor() {
}
}

View File

@@ -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() {
}
}

View File

@@ -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() {
}
}

View File

@@ -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() {
}
}

View File

@@ -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() {
}
}

View File

@@ -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 {

View File

@@ -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() {
}
}

View File

@@ -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<string>",
"type": "Array<string> ",
"format": ""
},
{
"name": "tags",
"baseName": "tags",
"type": "Array<Tag>",
"type": "Array<Tag> ",
"format": ""
},
{
"name": "status",
"baseName": "status",
"type": "PetStatusEnum",
"type": "PetStatusEnum ",
"format": ""
} ];
@@ -73,6 +73,7 @@ export class Pet {
}
public constructor() {
}
}

View File

@@ -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() {
}
}

View File

@@ -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() {
}
}

View File

@@ -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() {
}
}

View File

@@ -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() {
}
}

View File

@@ -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 {

View File

@@ -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() {
}
}

View File

@@ -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<string>",
"type": "Array<string> ",
"format": ""
},
{
"name": "tags",
"baseName": "tags",
"type": "Array<Tag>",
"type": "Array<Tag> ",
"format": ""
},
{
"name": "status",
"baseName": "status",
"type": "PetStatusEnum",
"type": "PetStatusEnum ",
"format": ""
} ];
@@ -73,6 +73,7 @@ export class Pet {
}
public constructor() {
}
}

View File

@@ -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() {
}
}

View File

@@ -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() {
}
}

View File

@@ -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() {
}
}

View File

@@ -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() {
}
}

View File

@@ -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 {

View File

@@ -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() {
}
}

View File

@@ -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<string>",
"type": "Array<string> ",
"format": ""
},
{
"name": "tags",
"baseName": "tags",
"type": "Array<Tag>",
"type": "Array<Tag> ",
"format": ""
},
{
"name": "status",
"baseName": "status",
"type": "PetStatusEnum",
"type": "PetStatusEnum ",
"format": ""
} ];
@@ -73,6 +73,7 @@ export class Pet {
}
public constructor() {
}
}

View File

@@ -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() {
}
}

View File

@@ -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() {
}
}