You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When executing a request using PHP generated code I am getting the following error: Cannot use "parent" when current class scope has no parent
This occurs (in my specific case) in the \Checkly\Client\Model\CheckList class with the listInvalidProperties method. The error is correct since the class does not extend another class since it is defined as following: class CheckList implements ModelInterface, ArrayAccess
This is the generated method:
public function listInvalidProperties()
{
$invalidProperties = parent::listInvalidProperties();
return $invalidProperties;
}
Please note that I have no experience with mustache or this library, but i did notice the following which might be the cause:
In the modules/swagger-codegen/src/main/resources/php/model_generic.mustache file i noticed that everywhere the {{#parentSchema}} block was used except for in the listInvalidProperties method, there the {{#parent}} block is used instead.
The text was updated successfully, but these errors were encountered:
akoziolsc
added a commit
to sitecrafting/gearlab-tools-php
that referenced
this issue
Oct 23, 2024
Description
When executing a request using PHP generated code I am getting the following error:
Cannot use "parent" when current class scope has no parent
This occurs (in my specific case) in the
\Checkly\Client\Model\CheckList
class with thelistInvalidProperties
method. The error is correct since the class does not extend another class since it is defined as following:class CheckList implements ModelInterface, ArrayAccess
This is the generated method:
Full file can be found here:
CheckList.txt
Swagger-codegen version
I am using version 3
Swagger declaration file content or url
I use the following swagger file:
https://api.checklyhq.com/swagger.json
Command line used for generation
I use the following command to generate the code:
Steps to reproduce
Generate the code, and execute a listing request.
Related issues/PRs
Suggest a fix/enhancement
Please note that I have no experience with mustache or this library, but i did notice the following which might be the cause:
In the
modules/swagger-codegen/src/main/resources/php/model_generic.mustache
file i noticed that everywhere the{{#parentSchema}}
block was used except for in thelistInvalidProperties
method, there the{{#parent}}
block is used instead.The text was updated successfully, but these errors were encountered: