microsoftgraph/msgraph-beta-sdk-php

Beta SDK Generation Issues

Ndiritu opened this issue ยท 2 comments

  1. Missing Microsoft\Graph\Beta\Generated\Models\Admin model:
 ------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
  109    Parameter $body of method Microsoft\Graph\Beta\Generated\Admin\AdminRequestBuilder::createPatchRequestInformation() has invalid type Microsoft\Graph\Beta\Generated\Models\Admin.  
  139    Class Microsoft\Graph\Beta\Generated\Models\Admin not found.                                                                                                                       
         ๐Ÿ’ก Learn more at https://phpstan.org/user-guide/discovering-symbols                                                                                                                 
  152    Parameter $body of method Microsoft\Graph\Beta\Generated\Admin\AdminRequestBuilder::patch() has invalid type Microsoft\Graph\Beta\Generated\Models\Admin. 
  1. Wrong request builder namespaces: Attempting to instantiate MicrosoftGraphBetaGeneratedGroupsItemCalendarCalendarViewItemExceptionOccurrencesItemEventItemRequestBuilder
  266    Method Microsoft\Graph\Beta\Generated\Groups\Item\Calendar\CalendarView\Item\EventItemRequestBuilder::exceptionOccurrencesById() has invalid return type                                    
         Microsoft\Graph\Beta\Generated\Groups\Item\Calendar\CalendarView\Item\MicrosoftGraphBetaGeneratedGroupsItemCalendarCalendarViewItemExceptionOccurrencesItemEventItemRequestBuilder.         
  269    Instantiated class                                                                                                                                                                          
         Microsoft\Graph\Beta\Generated\Groups\Item\Calendar\CalendarView\Item\MicrosoftGraphBetaGeneratedGroupsItemCalendarCalendarViewItemExceptionOccurrencesItemEventItemRequestBuilder not      
         found.  

Occurs in a few other request builders...

  1. Wrong model names in createDiscriminatorValue() when models are not in microsoft.graph.models namespace e.g. CallRecord
143    Instantiated class Microsoft\Graph\Beta\Generated\Models\CallRecord not found.                              
         ๐Ÿ’ก Learn more at https://phpstan.org/user-guide/discovering-symbols                                          
  144    Instantiated class Microsoft\Graph\Beta\Generated\Models\Segment not found.                                 
         ๐Ÿ’ก Learn more at https://phpstan.org/user-guide/discovering-symbols                                          
  145    Instantiated class Microsoft\Graph\Beta\Generated\Models\Session not found.                                 
         ๐Ÿ’ก Learn more at https://phpstan.org/user-guide/discovering-symbols                                          
  322    Instantiated class Microsoft\Graph\Beta\Generated\Models\EscapedCase not found.                             
         ๐Ÿ’ก Learn more at https://phpstan.org/user-guide/discovering-symbols                                          
  323    Instantiated class Microsoft\Graph\Beta\Generated\Models\CaseOperation not found.                           
         ๐Ÿ’ก Learn more at https://phpstan.org/user-guide/discovering-symbols                                          
...       

For the third one, these models live under a sub-namespace under the models namespace (so models/callrecords) and I can see that the subnamespace is missing from the import. Maybe worth investigating to understand whether the writer is pulling the information from the right place.

For the second one it seems that the writer is somehow appending the namespace/folder name to the request builder name, I'm not sure why it's doing that, but worth investigating to understand why we have the MicrosoftGraphBetaGenerated prefix.