Skip to content

Commit 4cd7ac5

Browse files
committed
update samples
1 parent d415003 commit 4cd7ac5

4 files changed

Lines changed: 12 additions & 4 deletions

File tree

‎samples/client/others/typescript-node/encode-decode/build/model/models.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ export class ObjectSerializer {
141141
let attributeType = attributeTypes[index];
142142
const value = Object.prototype.hasOwnProperty.call(data, attributeType.name)
143143
? data[attributeType.name]
144-
: data[attributeType.baseName];
144+
: Object.prototype.hasOwnProperty.call(data, attributeType.baseName)
145+
? data[attributeType.baseName]
146+
: undefined;
145147
instance[attributeType.baseName] = ObjectSerializer.serialize(value, attributeType.type);
146148
}
147149
return instance;

‎samples/client/petstore/typescript-node/3_0/model/models.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@ export class ObjectSerializer {
147147
let attributeType = attributeTypes[index];
148148
const value = Object.prototype.hasOwnProperty.call(data, attributeType.name)
149149
? data[attributeType.name]
150-
: data[attributeType.baseName];
150+
: Object.prototype.hasOwnProperty.call(data, attributeType.baseName)
151+
? data[attributeType.baseName]
152+
: undefined;
151153
instance[attributeType.baseName] = ObjectSerializer.serialize(value, attributeType.type);
152154
}
153155
return instance;

‎samples/client/petstore/typescript-node/default/model/models.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ export class ObjectSerializer {
155155
let attributeType = attributeTypes[index];
156156
const value = Object.prototype.hasOwnProperty.call(data, attributeType.name)
157157
? data[attributeType.name]
158-
: data[attributeType.baseName];
158+
: Object.prototype.hasOwnProperty.call(data, attributeType.baseName)
159+
? data[attributeType.baseName]
160+
: undefined;
159161
instance[attributeType.baseName] = ObjectSerializer.serialize(value, attributeType.type);
160162
}
161163
return instance;

‎samples/client/petstore/typescript-node/npm/model/models.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ export class ObjectSerializer {
155155
let attributeType = attributeTypes[index];
156156
const value = Object.prototype.hasOwnProperty.call(data, attributeType.name)
157157
? data[attributeType.name]
158-
: data[attributeType.baseName];
158+
: Object.prototype.hasOwnProperty.call(data, attributeType.baseName)
159+
? data[attributeType.baseName]
160+
: undefined;
159161
instance[attributeType.baseName] = ObjectSerializer.serialize(value, attributeType.type);
160162
}
161163
return instance;

0 commit comments

Comments
 (0)