microsoftgraph / microsoftgraph/msgraph-sdk-php

Invalid horizontalSectionLayoutType enum value flexible

Aperta
#1,697 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

needs investigation service bug
Lingua principale
PHP
Stelle
669
Fork
150
Merge medio
15h 21m
PR unite (30g)
3

Descrizione

Describe the bug

When loading an expanded canvasLayout using the new flexible layout you get an Invalid enum value flexible exception.

The new flexible layout type is missing from Microsoft\Graph\Generated\Models\HorizontalSectionLayoutType

Expected behavior

Page content is loaded without error

How to reproduce
        $requestConfig = new GraphSitePageRequestBuilderGetRequestConfiguration();
        $requestConfig->queryParameters = GraphSitePageRequestBuilderGetRequestConfiguration::createQueryParameters();
        $requestConfig->queryParameters->select = ['ID', 'canvasLayout'];
        $requestConfig->queryParameters->expand = ['canvasLayout'];
        $graphServiceClient->sites()->bySiteId(...)->pages()->graphSitePage()->get($requestConfig)->wait()
SDK Version

No response

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output
Click to expand log

InvalidArgumentException {#3210 // app/Integrations/SharePointIntegration.php:653
#message: "Invalid enum value flexible"
#code: 0
#file: "
/var/www/html/vendor
/microsoft/kiota-abstractions/
src/Enum.php"
#line: 57
trace: {

/var/www/html/vendor
/microsoft/kiota-abstractions/
src/Enum.php:57 {

Microsoft\Kiota\Abstractions

Enum->__construct(string $value) …
› if (!self::has($component)) {
› throw new InvalidArgumentException("Invalid enum value $value");
› }
}

/var/www/html/vendor
/microsoft/kiota-serialization-json/
src/JsonParseNode.php:170 {

Microsoft\Kiota\Serialization\Json

JsonParseNode->getEnumValue(string $targetEnum): Enum …
› }
› return new $targetEnum($this->jsonNode);
› }
}

/var/www/html/vendor
/microsoft/microsoft-graph/
src/Generated/Models/HorizontalSection.php:63 {

Microsoft\Graph\Generated\Models\HorizontalSection->Microsoft\Graph\Generated\Models

{closure} …
› 'emphasis' => fn(ParseNode $n) => $o->setEmphasis($n->getEnumValue(SectionEmphasisType::class)),
› 'layout' => fn(ParseNode $n) => $o->setLayout($n->getEnumValue(HorizontalSectionLayoutType::class)),
› ]);
}

/var/www/html/vendor
/microsoft/kiota-serialization-json/
src/JsonParseNode.php:147 {

Microsoft\Kiota\Serialization\Json

JsonParseNode->assignFieldValues($result): void …
› if ($deserializer !== null) {
› $deserializer(new JsonParseNode($value));
› } else {
}

/var/www/html/vendor
/microsoft/kiota-serialization-json/
src/JsonParseNode.php:120 {

Microsoft\Kiota\Serialization\Json

JsonParseNode->getObjectValue(array $type): Parsable …
› }
› $this->assignFieldValues($result);
› if ($this->getOnAfterAssignFieldValues() !== null){
}

/var/www/html/vendor
/microsoft/kiota-serialization-json/
src/JsonParseNode.php:95 {

Microsoft\Kiota\Serialization\Json\JsonParseNode::Microsoft\Kiota\Serialization\Json

{closure} …
› $result = array_map(static function ($val) use($type) {
› return $val->getObjectValue($type);
› }, array_map(static function ($value) {
}

Microsoft\Kiota\Serialization\Json\JsonParseNode::Microsoft\Kiota\Serialization\Json

{closure}() {}

/var/www/html/vendor
/microsoft/kiota-serialization-json/
src/JsonParseNode.php:94 {

Microsoft\Kiota\Serialization\Json

JsonParseNode->getCollectionOfObjectValues(array $type): ?array …
› }
› $result = array_map(static function ($val) use($type) {
› return $val->getObjectValue($type);
}

/var/www/html/vendor
/microsoft/microsoft-graph/
src/Generated/Models/CanvasLayout.php:35 {

Microsoft\Graph\Generated\Models\CanvasLayout->Microsoft\Graph\Generated\Models

{closure} …
› return array_merge(parent::getFieldDeserializers(), [
› 'horizontalSections' => fn(ParseNode $n) => $o->setHorizontalSections($n->getCollectionOfObjectValues([HorizontalSection::class, 'createFromDiscriminatorValue'])),
› 'verticalSection' => fn(ParseNode $n) => $o->setVerticalSection($n->getObjectValue([VerticalSection::class, 'createFromDiscriminatorValue'])),
}

/var/www/html/vendor
/microsoft/kiota-serialization-json/
src/JsonParseNode.php:147 {

Microsoft\Kiota\Serialization\Json

JsonParseNode->assignFieldValues($result): void …
› if ($deserializer !== null) {
› $deserializer(new JsonParseNode($value));
› } else {
}

/var/www/html/vendor
/microsoft/kiota-serialization-json/
src/JsonParseNode.php:120 {

Microsoft\Kiota\Serialization\Json

JsonParseNode->getObjectValue(array $type): Parsable …
› }
› $this->assignFieldValues($result);
› if ($this->getOnAfterAssignFieldValues() !== null){
}

/var/www/html/vendor
/microsoft/microsoft-graph/
src/Generated/Models/SitePage.php:47 {

Microsoft\Graph\Generated\Models\SitePage->Microsoft\Graph\Generated\Models

{closure} …
› return array_merge(parent::getFieldDeserializers(), [
› 'canvasLayout' => fn(ParseNode $n) => $o->setCanvasLayout($n->getObjectValue([CanvasLayout::class, 'createFromDiscriminatorValue'])),
› 'promotionKind' => fn(ParseNode $n) => $o->setPromotionKind($n->getEnumValue(PagePromotionType::class)),
}

/var/www/html/vendor
/microsoft/kiota-serialization-json/
src/JsonParseNode.php:147 {

Microsoft\Kiota\Serialization\Json

JsonParseNode->assignFieldValues($result): void …
› if ($deserializer !== null) {
› $deserializer(new JsonParseNode($value));
› } else {
}

/var/www/html/vendor
/microsoft/kiota-serialization-json/
src/JsonParseNode.php:120 {

Microsoft\Kiota\Serialization\Json

JsonParseNode->getObjectValue(array $type): Parsable …
› }
› $this->assignFieldValues($result);
› if ($this->getOnAfterAssignFieldValues() !== null){
}

/var/www/html/vendor
/microsoft/kiota-serialization-json/
src/JsonParseNode.php:95 {

Microsoft\Kiota\Serialization\Json\JsonParseNode::Microsoft\Kiota\Serialization\Json

{closure} …
› $result = array_map(static function ($val) use($type) {
› return $val->getObjectValue($type);
› }, array_map(static function ($value) {
}

Microsoft\Kiota\Serialization\Json\JsonParseNode::Microsoft\Kiota\Serialization\Json

{closure}() {}

/var/www/html/vendor
/microsoft/kiota-serialization-json/
src/JsonParseNode.php:94 {

Microsoft\Kiota\Serialization\Json

JsonParseNode->getCollectionOfObjectValues(array $type): ?array …
› }
› $result = array_map(static function ($val) use($type) {
› return $val->getObjectValue($type);
}

/var/www/html/vendor
/microsoft/microsoft-graph/
src/Generated/Models/SitePageCollectionResponse.php:35 {

Microsoft\Graph\Generated\Models\SitePageCollectionResponse->Microsoft\Graph\Generated\Models

{closure} …
› return array_merge(parent::getFieldDeserializers(), [
› 'value' => fn(ParseNode $n) => $o->setValue($n->getCollectionOfObjectValues([SitePage::class, 'createFromDiscriminatorValue'])),
› ]);
}

/var/www/html/vendor
/microsoft/kiota-serialization-json/
src/JsonParseNode.php:147 {

Microsoft\Kiota\Serialization\Json

JsonParseNode->assignFieldValues($result): void …
› if ($deserializer !== null) {
› $deserializer(new JsonParseNode($value));
› } else {
}

/var/www/html/vendor
/microsoft/kiota-serialization-json/
src/JsonParseNode.php:120 {

Microsoft\Kiota\Serialization\Json

JsonParseNode->getObjectValue(array $type): Parsable …
› }
› $this->assignFieldValues($result);
› if ($this->getOnAfterAssignFieldValues() !== null){
}

/var/www/html/vendor
/microsoft/kiota-http-guzzle/
src/GuzzleRequestAdapter.php:170 {

Microsoft\Kiota\Http\GuzzleRequestAdapter->Microsoft\Kiota\Http

{closure} …
› $this->setResponseType($targetCallable[0], $span);
› return $rootNode->getObjectValue($targetCallable);
› }
}

/var/www/html/vendor
/php-http/promise/
src/FulfilledPromise.php:39 {

Http\Promise

FulfilledPromise->then(?callable $onFulfilled = null, ?callable $onRejected = null) …
› try {
› return new self($onFulfilled($this->result));
› } catch (\Exception $e) {
}

/var/www/html/vendor
/microsoft/kiota-http-guzzle/
src/GuzzleRequestAdapter.php:145 {

Microsoft\Kiota\Http

GuzzleRequestAdapter->sendAsync(RequestInformation $requestInfo, array $targetCallable, ?array $errorMappings = null): Promise …
› $responseMessage = $this->getHttpResponseMessage($requestInfo, '', $span);
› $finalResponse = $responseMessage->then(
› function (ResponseInterface $result) use ($targetCallable, $requestInfo, $errorMappings, &$span) {
}

/var/www/html/vendor
/microsoft/microsoft-graph/
src/Generated/Sites/Item/Pages/GraphSitePage/GraphSitePageRequestBuilder.php:53 {

Microsoft\Graph\Generated\Sites\Item\Pages\GraphSitePage

GraphSitePageRequestBuilder->get(?GraphSitePageRequestBuilderGetRequestConfiguration $requestConfiguration = null): Promise …
› ];
› return $this->requestAdapter->sendAsync($requestInfo, [SitePageCollectionResponse::class, 'createFromDiscriminatorValue'], $errorMappings);
› }
}
}
}

Configuration

No response

Other information

No response

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con Microsoft\Graph\Generated\Models\HorizontalSectionLayoutType e il percorso di deserializzazione in src/Generated/Models/HorizontalSection.php. Riproduci la richiesta canvasLayout estesa descritta nell’issue, quindi verifica che il caricamento di una pagina con il layout flessibile non generi più Invalid enum value flexible.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
php
Ambito
api
Tipo di issue
Bug
Difficoltà
1/5
Tempo stimato
Meno di un'ora
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.