forked from loafle/openapi-generator-original
update js samples
This commit is contained in:
@@ -67,7 +67,7 @@ class Animal {
|
||||
static validateJSON(data) {
|
||||
// check to make sure all required properties are present in the JSON string
|
||||
for (const property of Animal.RequiredProperties) {
|
||||
if (!data[property]) {
|
||||
if (!data.hasOwnProperty(property)) {
|
||||
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ class BasquePig {
|
||||
static validateJSON(data) {
|
||||
// check to make sure all required properties are present in the JSON string
|
||||
for (const property of BasquePig.RequiredProperties) {
|
||||
if (!data[property]) {
|
||||
if (!data.hasOwnProperty(property)) {
|
||||
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ class Cat {
|
||||
static validateJSON(data) {
|
||||
// check to make sure all required properties are present in the JSON string
|
||||
for (const property of Cat.RequiredProperties) {
|
||||
if (!data[property]) {
|
||||
if (!data.hasOwnProperty(property)) {
|
||||
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ class Category {
|
||||
static validateJSON(data) {
|
||||
// check to make sure all required properties are present in the JSON string
|
||||
for (const property of Category.RequiredProperties) {
|
||||
if (!data[property]) {
|
||||
if (!data.hasOwnProperty(property)) {
|
||||
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ class DanishPig {
|
||||
static validateJSON(data) {
|
||||
// check to make sure all required properties are present in the JSON string
|
||||
for (const property of DanishPig.RequiredProperties) {
|
||||
if (!data[property]) {
|
||||
if (!data.hasOwnProperty(property)) {
|
||||
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ class Dog {
|
||||
static validateJSON(data) {
|
||||
// check to make sure all required properties are present in the JSON string
|
||||
for (const property of Dog.RequiredProperties) {
|
||||
if (!data[property]) {
|
||||
if (!data.hasOwnProperty(property)) {
|
||||
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ class EnumTest {
|
||||
static validateJSON(data) {
|
||||
// check to make sure all required properties are present in the JSON string
|
||||
for (const property of EnumTest.RequiredProperties) {
|
||||
if (!data[property]) {
|
||||
if (!data.hasOwnProperty(property)) {
|
||||
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ class FormatTest {
|
||||
static validateJSON(data) {
|
||||
// check to make sure all required properties are present in the JSON string
|
||||
for (const property of FormatTest.RequiredProperties) {
|
||||
if (!data[property]) {
|
||||
if (!data.hasOwnProperty(property)) {
|
||||
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ class Name {
|
||||
static validateJSON(data) {
|
||||
// check to make sure all required properties are present in the JSON string
|
||||
for (const property of Name.RequiredProperties) {
|
||||
if (!data[property]) {
|
||||
if (!data.hasOwnProperty(property)) {
|
||||
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ class OuterObjectWithEnumProperty {
|
||||
static validateJSON(data) {
|
||||
// check to make sure all required properties are present in the JSON string
|
||||
for (const property of OuterObjectWithEnumProperty.RequiredProperties) {
|
||||
if (!data[property]) {
|
||||
if (!data.hasOwnProperty(property)) {
|
||||
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ class Pet {
|
||||
static validateJSON(data) {
|
||||
// check to make sure all required properties are present in the JSON string
|
||||
for (const property of Pet.RequiredProperties) {
|
||||
if (!data[property]) {
|
||||
if (!data.hasOwnProperty(property)) {
|
||||
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user