forked from loafle/openapi-generator-original
[PHP] Fix parentSchema conditional causing parent call when parent isn't present (#8705)
* Fix parentSchema conditional we cannot call `parent::` if parent isn't present. Everywhere else in the schema we're checking for `{{parentSchema}}` but here we're checking for `{{parent}}` which is causing errors when parent is not present * Update samples
This commit is contained in:
parent
4aaaae765b
commit
ad9e2395ac
@ -188,12 +188,12 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
{{#parent}}
|
||||
{{#parentSchema}}
|
||||
$invalidProperties = parent::listInvalidProperties();
|
||||
{{/parent}}
|
||||
{{^parent}}
|
||||
{{/parentSchema}}
|
||||
{{^parentSchema}}
|
||||
$invalidProperties = [];
|
||||
{{/parent}}
|
||||
{{/parentSchema}}
|
||||
|
||||
{{#vars}}
|
||||
{{#required}}
|
||||
|
@ -254,7 +254,7 @@ class NullableClass implements ModelInterface, ArrayAccess, \JsonSerializable
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = parent::listInvalidProperties();
|
||||
$invalidProperties = [];
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user