Skip to content

Commit 963e16a

Browse files
committed
update js samples
1 parent 2f3f684 commit 963e16a

33 files changed

Lines changed: 33 additions & 33 deletions

samples/client/petstore/javascript-apollo/src/model/Animal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class Animal {
6767
static validateJSON(data) {
6868
// check to make sure all required properties are present in the JSON string
6969
for (const property of Animal.RequiredProperties) {
70-
if (!data[property]) {
70+
if (!data.hasOwnProperty(property)) {
7171
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
7272
}
7373
}

samples/client/petstore/javascript-apollo/src/model/BasquePig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class BasquePig {
6969
static validateJSON(data) {
7070
// check to make sure all required properties are present in the JSON string
7171
for (const property of BasquePig.RequiredProperties) {
72-
if (!data[property]) {
72+
if (!data.hasOwnProperty(property)) {
7373
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
7474
}
7575
}

samples/client/petstore/javascript-apollo/src/model/Cat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class Cat {
6868
static validateJSON(data) {
6969
// check to make sure all required properties are present in the JSON string
7070
for (const property of Cat.RequiredProperties) {
71-
if (!data[property]) {
71+
if (!data.hasOwnProperty(property)) {
7272
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
7373
}
7474
}

samples/client/petstore/javascript-apollo/src/model/Category.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class Category {
6767
static validateJSON(data) {
6868
// check to make sure all required properties are present in the JSON string
6969
for (const property of Category.RequiredProperties) {
70-
if (!data[property]) {
70+
if (!data.hasOwnProperty(property)) {
7171
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
7272
}
7373
}

samples/client/petstore/javascript-apollo/src/model/DanishPig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class DanishPig {
6969
static validateJSON(data) {
7070
// check to make sure all required properties are present in the JSON string
7171
for (const property of DanishPig.RequiredProperties) {
72-
if (!data[property]) {
72+
if (!data.hasOwnProperty(property)) {
7373
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
7474
}
7575
}

samples/client/petstore/javascript-apollo/src/model/Dog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class Dog {
6868
static validateJSON(data) {
6969
// check to make sure all required properties are present in the JSON string
7070
for (const property of Dog.RequiredProperties) {
71-
if (!data[property]) {
71+
if (!data.hasOwnProperty(property)) {
7272
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
7373
}
7474
}

samples/client/petstore/javascript-apollo/src/model/EnumTest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class EnumTest {
8989
static validateJSON(data) {
9090
// check to make sure all required properties are present in the JSON string
9191
for (const property of EnumTest.RequiredProperties) {
92-
if (!data[property]) {
92+
if (!data.hasOwnProperty(property)) {
9393
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
9494
}
9595
}

samples/client/petstore/javascript-apollo/src/model/FormatTest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class FormatTest {
115115
static validateJSON(data) {
116116
// check to make sure all required properties are present in the JSON string
117117
for (const property of FormatTest.RequiredProperties) {
118-
if (!data[property]) {
118+
if (!data.hasOwnProperty(property)) {
119119
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
120120
}
121121
}

samples/client/petstore/javascript-apollo/src/model/Name.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class Name {
7474
static validateJSON(data) {
7575
// check to make sure all required properties are present in the JSON string
7676
for (const property of Name.RequiredProperties) {
77-
if (!data[property]) {
77+
if (!data.hasOwnProperty(property)) {
7878
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
7979
}
8080
}

samples/client/petstore/javascript-apollo/src/model/OuterObjectWithEnumProperty.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class OuterObjectWithEnumProperty {
6565
static validateJSON(data) {
6666
// check to make sure all required properties are present in the JSON string
6767
for (const property of OuterObjectWithEnumProperty.RequiredProperties) {
68-
if (!data[property]) {
68+
if (!data.hasOwnProperty(property)) {
6969
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
7070
}
7171
}

0 commit comments

Comments
 (0)