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

Exception when using items/delta if there is a deleted item #812

Closed
nygsebjsc opened this issue Mar 12, 2024 · 0 comments
Closed

Exception when using items/delta if there is a deleted item #812

nygsebjsc opened this issue Mar 12, 2024 · 0 comments

Comments

@nygsebjsc
Copy link

Using

var response = await client.Sites[SiteId].Lists[ListId].Items.Delta.WithUrl(deltaLink).GetAsDeltaGetResponseAsync();

Will cause a json parse exception when there is an item has been deleted.

System.Text.Json.JsonReaderException: Expected depth to be zero at the end of the JSON payload. There is an open JSON object or array that should be closed. LineNumber: 0 | BytePositionInLine: 1102.
         at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan`1 bytes)
         at System.Text.Json.Utf8JsonReader.ReadSingleSegment()
         at System.Text.Json.Utf8JsonReader.Read()
         at System.Text.Json.JsonDocument.Parse(ReadOnlySpan`1 utf8JsonSpan, JsonReaderOptions readerOptions, MetadataDb& database, StackRowStack& stack)
         at System.Text.Json.JsonDocument.Parse(ReadOnlyMemory`1 utf8Json, JsonReaderOptions readerOptions, Byte[] extraRentedArrayPoolBytes, PooledByteBufferWriter extraPooledByteBufferWriter)
         at System.Text.Json.JsonDocument.Parse(Stream utf8Json, JsonDocumentOptions options)
         at Microsoft.Kiota.Serialization.Json.JsonParseNodeFactory.GetRootParseNode(String contentType, Stream content)
         at Microsoft.Kiota.Abstractions.Serialization.ParseNodeProxyFactory.GetRootParseNode(String contentType, Stream content)
         at Microsoft.Kiota.Abstractions.Serialization.ParseNodeFactoryRegistry.GetRootParseNode(String contentType, Stream content)
         at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.GetRootParseNode(HttpResponseMessage response, CancellationToken cancellationToken)
         at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.SendAsync[ModelType](RequestInformation requestInfo, ParsableFactory`1 factory, Dictionary`2 errorMapping, CancellationToken cancellationToken)
         at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.SendAsync[ModelType](RequestInformation requestInfo, ParsableFactory`1 factory, Dictionary`2 errorMapping, CancellationToken cancellationToken)
         at Microsoft.Graph.Beta.Sites.Item.Lists.Item.Items.Delta.DeltaRequestBuilder.GetAsDeltaGetResponseAsync(Action`1 requestConfiguration, CancellationToken cancellationToken)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant