forked from loafle/openapi-generator-original
Co-authored-by: Moritz Hannemann <m.hannemann@fz-juelich.de>
This commit is contained in:
parent
3858599be0
commit
2f3f684b7f
@ -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));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user