Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The JSON value could not be converted to System.Int32 : Handle Pnp Provisioning template extraction failure from Project Management site template #1058

Merged
merged 1 commit into from
Dec 14, 2022

Conversation

stokuri
Copy link
Contributor

@stokuri stokuri commented Dec 14, 2022

Cant extract Pnp Provisioning template from Project Management site template

Get-PnPSiteTemplate fails with the following error.

The JSON value could not be converted to System.Int32. Path: $.position.sectionIndex | LineNumber: 0 | BytePositionInLine: 107.

The issue is in pnpcore while Deserializing the controlDataJson.

The sample JSON for which the failure occurs:

controlDataJson: {"controlType":4,"id":"00000000-0000-0000-0000-100000000005","position":{"zoneIndex":1.0,"sectionIndex":2.0,"controlIndex":2.0,"sectionFactor":6,"layoutIndex":1},"emphasis":{}}

controlDataJson: {"controlType":3,"id":"00000000-0000-0000-0000-100000000006","position":{"zoneIndex":1.0,"sectionIndex":2.0,"controlIndex":3.0,"sectionFactor":6,"layoutIndex":1},"webPartId":"8654b779-4886-46d4-8ffb-b5ed960ee986","emphasis":{},"addedFromPersistedData":true}

The parser is failing to read "sectionIndex":2.0 property which is defend as int in CanvasPosition.cs but the actual value in JSON is float

@jansenbe jansenbe self-assigned this Dec 14, 2022
@jansenbe jansenbe added the area: pages API 📄 Working with modern pages label Dec 14, 2022
jansenbe added a commit that referenced this pull request Dec 14, 2022
@jansenbe jansenbe merged commit aefc90e into pnp:dev Dec 14, 2022
@stokuri
Copy link
Contributor Author

stokuri commented Dec 14, 2022

Thanks @jansenbe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: pages API 📄 Working with modern pages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants