Invalid horizontalSectionLayoutType enum value flexible
还没有人认领这个 Issue。
评估
调研方向
从 Microsoft\Graph\Generated\Models\HorizontalSectionLayoutType 以及 src/Generated/Models/HorizontalSection.php 中的反序列化路径开始。复现 issue 中描述的扩展 canvasLayout 请求,然后验证加载使用灵活布局的页面不再引发 Invalid enum value flexible。
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- PHP
- 星标
- 669
- 派生
- 150
- 平均合并
- 12 小时 6 分钟
- 30 天内合并 PR
- 2
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoftgraph/msgraph-sdk-php 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
microsoftgraph/msgraph-sdk-php#1794 · 2 条评论 ·
-
bug: metadata type:bug
难度 1/5 1 小时以内 新手友好度 88/100
microsoftgraph/msgraph-sdk-php#1739 · 6 条评论 ·
-
status:waiting-for-triage type:bug
难度 1/5 1 小时以内 新手友好度 68/100
microsoftgraph/msgraph-sdk-php#1643 · 8 条评论 · 4 个 reaction ·
-
status:waiting-for-triage
难度 5/5 一周以上 新手友好度 35/100
microsoftgraph/msgraph-sdk-php#1800 · 2 个 reaction ·
-
Now未关闭
难度 5/5 一周以上 新手友好度 1/100
microsoftgraph/msgraph-sdk-php#1799 ·
查看 microsoftgraph/msgraph-sdk-php 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
PrestaShopCorp/ps_accounts#666 ·
-
Security SecurityBundle
难度 2/5 1-3 小时 新手友好度 68/100
symfony/symfony-docs#23173 ·
维护者通常 3 天内回复
-
incomplete
难度 2/5 1-3 小时 新手友好度 75/100
opnsense/plugins#5763 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
fossology/fossology#3893 · 1 条评论 ·
维护者通常 2 天内回复
-
Documentation Feature: Self-Register / Verify UI
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复