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()
|
public function listInvalidProperties()
|
||||||
{
|
{
|
||||||
{{#parent}}
|
{{#parentSchema}}
|
||||||
$invalidProperties = parent::listInvalidProperties();
|
$invalidProperties = parent::listInvalidProperties();
|
||||||
{{/parent}}
|
{{/parentSchema}}
|
||||||
{{^parent}}
|
{{^parentSchema}}
|
||||||
$invalidProperties = [];
|
$invalidProperties = [];
|
||||||
{{/parent}}
|
{{/parentSchema}}
|
||||||
|
|
||||||
{{#vars}}
|
{{#vars}}
|
||||||
{{#required}}
|
{{#required}}
|
||||||
|
@ -254,7 +254,7 @@ class NullableClass implements ModelInterface, ArrayAccess, \JsonSerializable
|
|||||||
*/
|
*/
|
||||||
public function listInvalidProperties()
|
public function listInvalidProperties()
|
||||||
{
|
{
|
||||||
$invalidProperties = parent::listInvalidProperties();
|
$invalidProperties = [];
|
||||||
|
|
||||||
return $invalidProperties;
|
return $invalidProperties;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user