Skip to content

Commit 0b109da

Browse files
Merge pull request #841 from microsoftgraph/dependabot/nuget/xunit-2.8.1
chore(deps): bump xunit from 2.8.0 to 2.8.1
2 parents a72702a + 49fc6fc commit 0b109da

File tree

8 files changed

+34
-28
lines changed

8 files changed

+34
-28
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project does adheres to [Semantic Versioning](https://semver.org/spec/v
77

88
## [Unreleased]
99

10+
## [3.1.12] - 2024-05-28
11+
12+
### Changed
13+
14+
- Updates the Kiota dependencies to the latest version.
15+
1016
## [3.1.11] - 2024-04-30
1117

1218
### Changed

src/Microsoft.Graph.Core/Extensions/IDecryptableContentExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ public static class IDecryptableContentExtensions
3737
var stringContent = await encryptedContent.DecryptAsync(certificateProvider).ConfigureAwait(false);
3838
using var contentStream = new MemoryStream(Encoding.UTF8.GetBytes(stringContent));
3939
var parseNodeFactory = ParseNodeFactoryRegistry.DefaultInstance;
40-
var rootNode = parseNodeFactory.GetRootParseNode(CoreConstants.MimeTypeNames.Application.Json, contentStream);
41-
return rootNode.GetObjectValue<T>((parsable) => new T()); ;
40+
var rootNode = await parseNodeFactory.GetRootParseNodeAsync(CoreConstants.MimeTypeNames.Application.Json, contentStream);
41+
return rootNode.GetObjectValue<T>((parsable) => new T());
4242
}
4343

4444
/// <summary>

src/Microsoft.Graph.Core/Microsoft.Graph.Core.csproj

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<DelaySign>false</DelaySign>
2121
<AssemblyOriginatorKeyFile>35MSSharedLib1024.snk</AssemblyOriginatorKeyFile>
2222
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
23-
<VersionPrefix>3.1.11</VersionPrefix>
23+
<VersionPrefix>3.1.12</VersionPrefix>
2424
<VersionSuffix></VersionSuffix>
2525
<PackageReleaseNotes>
2626
- https://github.com/microsoftgraph/msgraph-sdk-dotnet-core/blob/dev/CHANGELOG.md
@@ -57,15 +57,15 @@
5757
</None>
5858
</ItemGroup>
5959
<ItemGroup>
60-
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="7.5.1" />
60+
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="7.6.0" />
6161
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
62-
<PackageReference Include="Microsoft.Kiota.Abstractions" Version="1.8.4" />
63-
<PackageReference Include="Microsoft.Kiota.Authentication.Azure" Version="1.1.5" />
64-
<PackageReference Include="Microsoft.Kiota.Serialization.Json" Version="1.2.3" />
65-
<PackageReference Include="Microsoft.Kiota.Serialization.Text" Version="1.1.5" />
66-
<PackageReference Include="Microsoft.Kiota.Serialization.Form" Version="1.1.6" />
67-
<PackageReference Include="Microsoft.Kiota.Http.HttpClientLibrary" Version="1.4.0" />
68-
<PackageReference Include="Microsoft.Kiota.Serialization.Multipart" Version="1.1.4" />
62+
<PackageReference Include="Microsoft.Kiota.Abstractions" Version="[1.9.1, 2.0.0)" />
63+
<PackageReference Include="Microsoft.Kiota.Authentication.Azure" Version="[1.1.7, 2.0.0)" />
64+
<PackageReference Include="Microsoft.Kiota.Serialization.Json" Version="[1.3.3, 2.0.0)" />
65+
<PackageReference Include="Microsoft.Kiota.Serialization.Text" Version="[1.2.2, 2.0.0)" />
66+
<PackageReference Include="Microsoft.Kiota.Serialization.Form" Version="[1.2.4, 2.0.0)" />
67+
<PackageReference Include="Microsoft.Kiota.Http.HttpClientLibrary" Version="[1.4.3, 2.0.0)" />
68+
<PackageReference Include="Microsoft.Kiota.Serialization.Multipart" Version="[1.1.5, 2.0.0)" />
6969
</ItemGroup>
7070
<ItemGroup Condition=" '$(TargetFramework)' == 'net462' ">
7171
<PackageReference Include="System.Net.Http.WinHttpHandler" Version="[6.0,9.0)" />

src/Microsoft.Graph.Core/Requests/AsyncMonitor.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace Microsoft.Graph
2424

2525
internal string monitorUrl;
2626

27-
private readonly IParseNodeFactory parseNodeFactory;
27+
private readonly IAsyncParseNodeFactory parseNodeFactory;
2828
/// <summary>
2929
/// Construct an Async Monitor.
3030
/// </summary>
@@ -35,7 +35,7 @@ public AsyncMonitor(IBaseClient client, string monitorUrl, IParseNodeFactory par
3535
{
3636
this.client = client;
3737
this.monitorUrl = monitorUrl;
38-
this.parseNodeFactory = parseNodeFactory ?? ParseNodeFactoryRegistry.DefaultInstance;
38+
this.parseNodeFactory = parseNodeFactory as IAsyncParseNodeFactory ?? ParseNodeFactoryRegistry.DefaultInstance;
3939
}
4040

4141
/// <summary>
@@ -59,12 +59,12 @@ public async Task<T> PollForOperationCompletionAsync(IProgress<AsyncOperationSta
5959
if (responseMessage.StatusCode != HttpStatusCode.Accepted && responseMessage.IsSuccessStatusCode)
6060
{
6161
using var responseStream = await responseMessage.Content.ReadAsStreamAsync().ConfigureAwait(false);
62-
return responseStream.Length > 0 ? parseNodeFactory.GetRootParseNode(CoreConstants.MimeTypeNames.Application.Json, responseStream).GetObjectValue(_ => new T()) : default;
62+
return responseStream.Length > 0 ? (await parseNodeFactory.GetRootParseNodeAsync(CoreConstants.MimeTypeNames.Application.Json, responseStream, cancellationToken)).GetObjectValue(_ => new T()) : default;
6363
}
6464

6565
using (var responseStream = await responseMessage.Content.ReadAsStreamAsync().ConfigureAwait(false))
6666
{
67-
this.asyncOperationStatus = responseStream.Length > 0 ? parseNodeFactory.GetRootParseNode(CoreConstants.MimeTypeNames.Application.Json, responseStream).GetObjectValue(_ => new AsyncOperationStatus()) : null;
67+
this.asyncOperationStatus = responseStream.Length > 0 ? (await parseNodeFactory.GetRootParseNodeAsync(CoreConstants.MimeTypeNames.Application.Json, responseStream, cancellationToken).ConfigureAwait(false)).GetObjectValue(_ => new AsyncOperationStatus()) : null;
6868

6969
if (this.asyncOperationStatus == null)
7070
{

src/Microsoft.Graph.Core/Requests/DeltaResponseHandler.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ namespace Microsoft.Graph
2929
/// </summary>
3030
public class DeltaResponseHandler<T> : IResponseHandler where T : IParsable, new()
3131
{
32-
private readonly IParseNodeFactory parseNodeFactory;
32+
private readonly IAsyncParseNodeFactory parseNodeFactory;
3333

3434
/// <summary>
3535
/// Constructs a new <see cref="DeltaResponseHandler{T}"/>.
3636
/// </summary>
3737
/// <param name="parseNodeFactory"> The <see cref="IParseNodeFactory"/> to use for response handling</param>
3838
public DeltaResponseHandler(IParseNodeFactory parseNodeFactory = null)
3939
{
40-
this.parseNodeFactory = parseNodeFactory ?? ParseNodeFactoryRegistry.DefaultInstance;
40+
this.parseNodeFactory = parseNodeFactory as IAsyncParseNodeFactory ?? ParseNodeFactoryRegistry.DefaultInstance;
4141
}
4242

4343
/// <summary>
@@ -61,7 +61,7 @@ public async Task<ModelType> HandleResponseAsync<NativeResponseType, ModelType>(
6161
var responseWithChangeList = await GetResponseBodyWithChangelist(responseString).ConfigureAwait(false);
6262
using var responseWithChangeListStream = new MemoryStream(Encoding.UTF8.GetBytes(responseWithChangeList));
6363

64-
var responseParseNode = parseNodeFactory.GetRootParseNode(CoreConstants.MimeTypeNames.Application.Json, responseWithChangeListStream);
64+
var responseParseNode = await parseNodeFactory.GetRootParseNodeAsync(CoreConstants.MimeTypeNames.Application.Json, responseWithChangeListStream);
6565
return (ModelType)(object)responseParseNode.GetObjectValue<T>((parsable) => new T());
6666
}
6767

src/Microsoft.Graph.Core/Requests/ResponseHandler.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ namespace Microsoft.Graph
1818
/// </summary>
1919
public class ResponseHandler<T> : IResponseHandler where T : IParsable,new()
2020
{
21-
private readonly IParseNodeFactory _jsonParseNodeFactory;
21+
private readonly IAsyncParseNodeFactory _jsonParseNodeFactory;
2222

2323
/// <summary>
2424
/// Constructs a new <see cref="ResponseHandler{T}"/>.
2525
/// </summary>
2626
/// <param name="parseNodeFactory"> The <see cref="IParseNodeFactory"/> to use for response handling</param>
2727
public ResponseHandler(IParseNodeFactory parseNodeFactory = null)
2828
{
29-
_jsonParseNodeFactory = parseNodeFactory ?? ParseNodeFactoryRegistry.DefaultInstance; ;
29+
_jsonParseNodeFactory = parseNodeFactory as IAsyncParseNodeFactory ?? ParseNodeFactoryRegistry.DefaultInstance; ;
3030
}
3131

3232
/// <summary>
@@ -43,7 +43,7 @@ public async Task<ModelType> HandleResponseAsync<NativeResponseType, ModelType>(
4343
{
4444
await ValidateSuccessfulResponse(responseMessage, errorMappings).ConfigureAwait(false);
4545
using var responseStream = await responseMessage.Content.ReadAsStreamAsync().ConfigureAwait(false);
46-
var jsonParseNode = _jsonParseNodeFactory.GetRootParseNode(responseMessage.Content.Headers?.ContentType?.MediaType?.ToLowerInvariant(), responseStream);
46+
var jsonParseNode = await _jsonParseNodeFactory.GetRootParseNodeAsync(responseMessage.Content.Headers?.ContentType?.MediaType?.ToLowerInvariant(), responseStream);
4747
return (ModelType)(object)jsonParseNode.GetObjectValue<T>((parsable) => new T());
4848
}
4949

@@ -64,7 +64,7 @@ private async Task ValidateSuccessfulResponse(HttpResponseMessage httpResponseMe
6464
var statusCodeAsInt = (int)httpResponseMessage.StatusCode;
6565
var statusCodeAsString = statusCodeAsInt.ToString();
6666
using var responseStream = await httpResponseMessage.Content.ReadAsStreamAsync().ConfigureAwait(false);
67-
var rootNode = _jsonParseNodeFactory.GetRootParseNode(httpResponseMessage.Content.Headers?.ContentType?.MediaType?.ToLowerInvariant(), responseStream);
67+
var rootNode = await _jsonParseNodeFactory.GetRootParseNodeAsync(httpResponseMessage.Content.Headers?.ContentType?.MediaType?.ToLowerInvariant(), responseStream);
6868
ParsableFactory <IParsable> errorFactory;
6969
if (errorMapping == null ||
7070
!errorMapping.TryGetValue(statusCodeAsString, out errorFactory) &&

src/Microsoft.Graph.Core/Requests/Upload/UploadResponseHandler.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ namespace Microsoft.Graph
1717
/// </summary>
1818
internal class UploadResponseHandler
1919
{
20-
private readonly IParseNodeFactory _parseNodeFactory;
20+
private readonly IAsyncParseNodeFactory _parseNodeFactory;
2121

2222
/// <summary>
2323
/// Constructs a new <see cref="UploadResponseHandler"/>.
2424
/// </summary>
2525
/// <param name="parseNodeFactory"> The <see cref="IParseNodeFactory"/> to use for response handling</param>
2626
public UploadResponseHandler(IParseNodeFactory parseNodeFactory = null)
2727
{
28-
_parseNodeFactory = parseNodeFactory ?? ParseNodeFactoryRegistry.DefaultInstance;
28+
_parseNodeFactory = parseNodeFactory as IAsyncParseNodeFactory ?? ParseNodeFactoryRegistry.DefaultInstance;
2929
}
3030

3131
/// <summary>
@@ -63,7 +63,7 @@ public async Task<UploadResult<T>> HandleResponse<T>(HttpResponseMessage respons
6363
{
6464
if (responseStream.Length > 0) //system.text.json wont deserialize an empty string
6565
{
66-
var jsonParseNode = _parseNodeFactory.GetRootParseNode(response.Content.Headers?.ContentType?.MediaType?.ToLowerInvariant(), responseStream);
66+
var jsonParseNode = await _parseNodeFactory.GetRootParseNodeAsync(response.Content.Headers?.ContentType?.MediaType?.ToLowerInvariant(), responseStream);
6767
uploadResult.ItemResponse = jsonParseNode.GetObjectValue<T>((parsable) => new T());
6868
}
6969
uploadResult.Location = response.Headers.Location;
@@ -76,7 +76,7 @@ public async Task<UploadResult<T>> HandleResponse<T>(HttpResponseMessage respons
7676
* However, successful upload completion for a DriveItem the response could also come in a 200 response and
7777
* hence we validate this by checking the NextExpectedRanges parameter which is present in an ongoing upload
7878
*/
79-
var uploadSessionParseNode = _parseNodeFactory.GetRootParseNode(response.Content.Headers?.ContentType?.MediaType?.ToLowerInvariant(), responseStream);
79+
var uploadSessionParseNode = await _parseNodeFactory.GetRootParseNodeAsync(response.Content.Headers?.ContentType?.MediaType?.ToLowerInvariant(), responseStream);
8080
UploadSession uploadSession = uploadSessionParseNode.GetObjectValue<UploadSession>(UploadSession.CreateFromDiscriminatorValue);
8181
if (uploadSession?.NextExpectedRanges != null)
8282
{
@@ -86,7 +86,7 @@ public async Task<UploadResult<T>> HandleResponse<T>(HttpResponseMessage respons
8686
{
8787
//Upload is most likely done as DriveItem info may come in a 200 response
8888
responseStream.Position = 0; //reset
89-
var objectParseNode = _parseNodeFactory.GetRootParseNode(response.Content.Headers?.ContentType?.MediaType?.ToLowerInvariant(), responseStream);
89+
var objectParseNode = await _parseNodeFactory.GetRootParseNodeAsync(response.Content.Headers?.ContentType?.MediaType?.ToLowerInvariant(), responseStream);
9090
uploadResult.ItemResponse = objectParseNode.GetObjectValue<T>((parsable) => new T());
9191
}
9292
}

tests/Microsoft.Graph.DotnetCore.Core.Test/Microsoft.Graph.DotnetCore.Core.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
</PackageReference>
2626
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
2727
<PackageReference Include="Moq" Version="4.20.70" />
28-
<PackageReference Include="xunit" Version="2.8.0" />
28+
<PackageReference Include="xunit" Version="2.8.1" />
2929
<ProjectReference Include="..\..\src\Microsoft.Graph.Core\Microsoft.Graph.Core.csproj" />
3030
</ItemGroup>
3131
<ItemGroup>

0 commit comments

Comments
 (0)