Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,12 @@ export class ObjectSerializer {
let instance: {[index: string]: any} = {};
for (let index = 0; index < attributeTypes.length; index++) {
let attributeType = attributeTypes[index];
instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type);
const value = Object.prototype.hasOwnProperty.call(data, attributeType.name)
? data[attributeType.name]
: Object.prototype.hasOwnProperty.call(data, attributeType.baseName)
? data[attributeType.baseName]
: undefined;
instance[attributeType.baseName] = ObjectSerializer.serialize(value, attributeType.type);
}
return instance;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,10 @@ export class ObjectSerializer {
let attributeTypes = typeMap[type].getAttributeTypeMap();
let instance: {[index: string]: any} = {};
for (let attributeType of attributeTypes) {
instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type, attributeType.format);
const value = Object.prototype.hasOwnProperty.call(data, attributeType.name)
? data[attributeType.name]
: data[attributeType.baseName];
instance[attributeType.baseName] = ObjectSerializer.serialize(value, attributeType.type, attributeType.format);
}
return instance;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ export class ObjectSerializer {
let instance: {[index: string]: any} = {};
for (let index in attributeTypes) {
let attributeType = attributeTypes[index];
instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type);
const value = Object.prototype.hasOwnProperty.call(data, attributeType.name)
? data[attributeType.name]
: data[attributeType.baseName];
instance[attributeType.baseName] = ObjectSerializer.serialize(value, attributeType.type);
}
return instance;
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,12 @@ export class ObjectSerializer {
let instance: {[index: string]: any} = {};
for (let index = 0; index < attributeTypes.length; index++) {
let attributeType = attributeTypes[index];
instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type);
const value = Object.prototype.hasOwnProperty.call(data, attributeType.name)
? data[attributeType.name]
: Object.prototype.hasOwnProperty.call(data, attributeType.baseName)
? data[attributeType.baseName]
: undefined;
instance[attributeType.baseName] = ObjectSerializer.serialize(value, attributeType.type);
}
return instance;
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion samples/client/petstore/typescript-node/3_0/model/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,12 @@ export class ObjectSerializer {
let instance: {[index: string]: any} = {};
for (let index = 0; index < attributeTypes.length; index++) {
let attributeType = attributeTypes[index];
instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type);
const value = Object.prototype.hasOwnProperty.call(data, attributeType.name)
? data[attributeType.name]
: Object.prototype.hasOwnProperty.call(data, attributeType.baseName)
? data[attributeType.baseName]
: undefined;
instance[attributeType.baseName] = ObjectSerializer.serialize(value, attributeType.type);
}
return instance;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,12 @@ export class ObjectSerializer {
let instance: {[index: string]: any} = {};
for (let index = 0; index < attributeTypes.length; index++) {
let attributeType = attributeTypes[index];
instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type);
const value = Object.prototype.hasOwnProperty.call(data, attributeType.name)
? data[attributeType.name]
: Object.prototype.hasOwnProperty.call(data, attributeType.baseName)
? data[attributeType.baseName]
: undefined;
instance[attributeType.baseName] = ObjectSerializer.serialize(value, attributeType.type);
}
return instance;
}
Expand Down
7 changes: 6 additions & 1 deletion samples/client/petstore/typescript-node/npm/model/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,12 @@ export class ObjectSerializer {
let instance: {[index: string]: any} = {};
for (let index = 0; index < attributeTypes.length; index++) {
let attributeType = attributeTypes[index];
instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type);
const value = Object.prototype.hasOwnProperty.call(data, attributeType.name)
? data[attributeType.name]
: Object.prototype.hasOwnProperty.call(data, attributeType.baseName)
? data[attributeType.baseName]
: undefined;
instance[attributeType.baseName] = ObjectSerializer.serialize(value, attributeType.type);
}
return instance;
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading