Skip to content

[PHP] Error "staticMethod.notFound" for NOTION.COM api #7809

Description

@WolfgangHG

Found as part of #7774:

Using the source code from 2026-06-17 and this command:

.\it\generate-code.ps1 -descriptionUrl https://developers.notion.com/openapi.json  -language "php" -dev
.\it\exec-cmd.ps1 -descriptionUrl https://developers.notion.com/openapi.json  -language "php"

The generated client does not compile:

Error: Call to an undefined static method Integration\Test\Client\Models\InternalOrExternalFileWithNameResponseCommon::__construct().
Error: Call to an undefined static method Integration\Test\Client\Models\RichTextItemResponseCommon::__construct().
Error: Call to an undefined static method Integration\Test\Client\Models\UserObjectResponseCommon::__construct().
 ------ ----------------------------------------------------------------------- 
  Line   Client/Models/InternalOrExternalFileWithNameResponse.php               
 ------ ----------------------------------------------------------------------- 
  21     Call to an undefined static method                                     
         Integration\Test\Client\Models\InternalOrExternalFileWithNameResponseCommon::__construct().                                                 
            staticMethod.notFound                                              
 ------ ----------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------- 
  Line   Client/Models/RichTextItemResponse.php                                 
 ------ ----------------------------------------------------------------------- 
  21     Call to an undefined static method                                     
         Integration\Test\Client\Models\RichTextItemResponseCommon::__construct().                                                                   
            staticMethod.notFound                                              
 ------ ----------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------- 
  Line   Client/Models/UserObjectResponse.php                                   
 ------ ----------------------------------------------------------------------- 
  21     Call to an undefined static method                                     
         Integration\Test\Client\Models\UserObjectResponseCommon::__construct().                                                                     
            staticMethod.notFound                                              
 ------ ----------------------------------------------------------------------- 

Error:  [ERROR] Found 3 errors                                                         

This is the relevant code:

class InternalOrExternalFileWithNameResponse extends InternalOrExternalFileWithNameResponseCommon implements AdditionalDataHolder, Parsable 
{
    ...
   
    public function __construct() {
        parent::__construct();
        $this->setAdditionalData([]);
    }

The base class has no "_construct" function - is this the reason for the error?

class InternalOrExternalFileWithNameResponseCommon implements Parsable 
{

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Done ✔️

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions