Co-authored-by: Moritz Hannemann <m.hannemann@fz-juelich.de>
This commit is contained in:
Moritz 2024-02-06 09:56:28 +01:00 committed by GitHub
parent 3858599be0
commit 2f3f684b7f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -64,7 +64,7 @@ class {{classname}} {{#parent}}{{^parentModel}}{{#vendorExtensions.x-is-array}}e
{{#-first}}
// check to make sure all required properties are present in the JSON string
for (const property of {{classname}}.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));
}
}