From d1b5780819d181864fc1a925211c212e63da2599 Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Tue, 16 Jul 2024 15:14:31 +0300 Subject: [PATCH 01/11] [WIP] Adds bundle package. --- CHANGELOG.md | 4 ++ Directory.Build.props | 2 +- Microsoft.Kiota.sln | 14 +++++- src/bundle/KiotaRequestAdapter.cs | 47 +++++++++++++++++++ src/bundle/Microsoft.Kiota.Bundle.csproj | 22 +++++++++ src/bundle/README.md | 37 +++++++++++++++ tests/bundle/BundleTests.cs | 46 ++++++++++++++++++ .../Microsoft.Kiota.Bundle.Tests.csproj | 33 +++++++++++++ tests/serialization/text/UnitTest1.cs | 12 ----- 9 files changed, 203 insertions(+), 14 deletions(-) create mode 100644 src/bundle/KiotaRequestAdapter.cs create mode 100644 src/bundle/Microsoft.Kiota.Bundle.csproj create mode 100644 src/bundle/README.md create mode 100644 tests/bundle/BundleTests.cs create mode 100644 tests/bundle/Microsoft.Kiota.Bundle.Tests.csproj delete mode 100644 tests/serialization/text/UnitTest1.cs diff --git a/CHANGELOG.md b/CHANGELOG.md index 520e42a8..4a6401c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.9.9] - 2024-07-17 + +- Adds Kiota bundle package to provide default adapter with registrations setup. [#290](https://github.com/microsoft/kiota-dotnet/issues/290) + ## [1.9.9] - 2024-07-12 - Fix enum deserialization for SendPrimitiveAsync and SendPrimitiveCollectionAsync diff --git a/Directory.Build.props b/Directory.Build.props index 131c0a8e..5c74e20b 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - 1.9.9 + 1.10.0 false diff --git a/Microsoft.Kiota.sln b/Microsoft.Kiota.sln index 61af83d9..96ec5f6c 100644 --- a/Microsoft.Kiota.sln +++ b/Microsoft.Kiota.sln @@ -44,7 +44,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Kiota.Serializati EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Kiota.Serialization.Text.Tests", "tests\serialization\text\Microsoft.Kiota.Serialization.Text.Tests.csproj", "{5F6AC278-C4A4-4EED-A7D3-1750A4D6FD15}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Kiota.Trimming.Validation", "tests\trimming\Microsoft.Kiota.Trimming.Validation\Microsoft.Kiota.Trimming.Validation.csproj", "{13992912-662D-4A3B-9354-DD49DB1AC2D5}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Kiota.Trimming.Validation", "tests\trimming\Microsoft.Kiota.Trimming.Validation\Microsoft.Kiota.Trimming.Validation.csproj", "{13992912-662D-4A3B-9354-DD49DB1AC2D5}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Kiota.Bundle", "src\bundle\Microsoft.Kiota.Bundle.csproj", "{3F1F2EF2-8C57-4FC2-9722-68FAE551D19E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Kiota.Bundle.Tests", "tests\bundle\Microsoft.Kiota.Bundle.Tests.csproj", "{A1155A75-88FB-4C21-AA96-240A0E69FF1A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -116,6 +120,14 @@ Global {13992912-662D-4A3B-9354-DD49DB1AC2D5}.Debug|Any CPU.Build.0 = Debug|Any CPU {13992912-662D-4A3B-9354-DD49DB1AC2D5}.Release|Any CPU.ActiveCfg = Release|Any CPU {13992912-662D-4A3B-9354-DD49DB1AC2D5}.Release|Any CPU.Build.0 = Release|Any CPU + {3F1F2EF2-8C57-4FC2-9722-68FAE551D19E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3F1F2EF2-8C57-4FC2-9722-68FAE551D19E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3F1F2EF2-8C57-4FC2-9722-68FAE551D19E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3F1F2EF2-8C57-4FC2-9722-68FAE551D19E}.Release|Any CPU.Build.0 = Release|Any CPU + {A1155A75-88FB-4C21-AA96-240A0E69FF1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A1155A75-88FB-4C21-AA96-240A0E69FF1A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A1155A75-88FB-4C21-AA96-240A0E69FF1A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A1155A75-88FB-4C21-AA96-240A0E69FF1A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/bundle/KiotaRequestAdapter.cs b/src/bundle/KiotaRequestAdapter.cs new file mode 100644 index 00000000..fadb4e5e --- /dev/null +++ b/src/bundle/KiotaRequestAdapter.cs @@ -0,0 +1,47 @@ +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +using System.Net.Http; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Authentication; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Http.HttpClientLibrary; +using Microsoft.Kiota.Serialization.Form; +using Microsoft.Kiota.Serialization.Json; +using Microsoft.Kiota.Serialization.Multipart; +using Microsoft.Kiota.Serialization.Text; + +namespace Microsoft.Kiota +{ + /// + /// The implementation that derived from with registrations configured. + /// + public class KiotaRequestAdapter : HttpClientRequestAdapter + { + /// + /// + /// + /// + /// + /// + /// + /// + public KiotaRequestAdapter(IAuthenticationProvider authenticationProvider, IParseNodeFactory? parseNodeFactory = null, ISerializationWriterFactory? serializationWriterFactory = null, HttpClient? httpClient = null, ObservabilityOptions? observabilityOptions = null) : base(authenticationProvider, parseNodeFactory, serializationWriterFactory, httpClient, observabilityOptions) + { + SetupDefaults(); + } + + private static void SetupDefaults() + { + // Setup the default serializers/deserializers + ApiClientBuilder.RegisterDefaultSerializer(); + ApiClientBuilder.RegisterDefaultSerializer(); + ApiClientBuilder.RegisterDefaultSerializer(); + ApiClientBuilder.RegisterDefaultSerializer(); + ApiClientBuilder.RegisterDefaultDeserializer(); + ApiClientBuilder.RegisterDefaultDeserializer(); + ApiClientBuilder.RegisterDefaultDeserializer(); + } + } +} diff --git a/src/bundle/Microsoft.Kiota.Bundle.csproj b/src/bundle/Microsoft.Kiota.Bundle.csproj new file mode 100644 index 00000000..2f9bcbf0 --- /dev/null +++ b/src/bundle/Microsoft.Kiota.Bundle.csproj @@ -0,0 +1,22 @@ + + + + + Kiota Bundle package providing default implementations for client setup. + Kiota Bundle package for dotnet + + netstandard2.0;netstandard2.1;net5.0;net6.0;net8.0 + true + + + + + + + + + + + + + diff --git a/src/bundle/README.md b/src/bundle/README.md new file mode 100644 index 00000000..7eb6413b --- /dev/null +++ b/src/bundle/README.md @@ -0,0 +1,37 @@ +# Kiota Bundle Library for dotnet + +The Kiota Bundle Library for dotnet is the dotnet library providing default implementations for client setup. + +Read more about Kiota [here](https://github.com/microsoft/kiota/blob/main/README.md). + +## Using the Abstractions Library + +```shell +dotnet add package Microsoft.Kiota.Bundle +``` + +## Debugging + +If you are using Visual Studio Code as your IDE, the **launch.json** file already contains the configuration to build and test the library. Otherwise, you can open the **Microsoft.Kiota.Abstractions.sln** with Visual Studio. + +## Contributing + +This project welcomes contributions and suggestions. Most contributions require you to agree to a +Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us +the rights to use your contribution. For details, visit [https://cla.opensource.microsoft.com](https://cla.opensource.microsoft.com). + +When you submit a pull request, a CLA bot will automatically determine whether you need to provide +a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions +provided by the bot. You will only need to do this once across all repos using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or +contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. + +## Trademarks + +This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft +trademarks or logos is subject to and must follow +[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/legal/intellectualproperty/trademarks/usage/general). +Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. +Any use of third-party trademarks or logos are subject to those third-party's policies. diff --git a/tests/bundle/BundleTests.cs b/tests/bundle/BundleTests.cs new file mode 100644 index 00000000..34f18330 --- /dev/null +++ b/tests/bundle/BundleTests.cs @@ -0,0 +1,46 @@ +using Xunit; +using Moq; +using System; +using Microsoft.Kiota.Abstractions.Authentication; +using Microsoft.Kiota.Abstractions.Serialization; + +namespace Microsoft.Kiota.Bundle.Tests +{ + public class BundleTests + { + [Fact] + public void ThrowsArgumentNullExceptionOnNullAuthenticationProvider() + { + var exception = Assert.Throws(() => new KiotaRequestAdapter(null!)); + Assert.Equal("authenticationProvider", exception.ParamName); + } + + [Fact] + public void SerializersAreRegisteredAsExpected() + { + // setup + KiotaRequestAdapter requestAdapter = new KiotaRequestAdapter(new AnonymousAuthenticationProvider()); + + // validate + var serializerCount = SerializationWriterFactoryRegistry.DefaultInstance.ContentTypeAssociatedFactories.Count; + var deserializerCount = ParseNodeFactoryRegistry.DefaultInstance.ContentTypeAssociatedFactories.Count; + + Assert.Equal(4, serializerCount); // four serializers present + Assert.Equal(3, deserializerCount);// three deserializers present + + var serializerKeys = SerializationWriterFactoryRegistry.DefaultInstance.ContentTypeAssociatedFactories.Keys; + var deserializerKeys = ParseNodeFactoryRegistry.DefaultInstance.ContentTypeAssociatedFactories.Keys; + + Assert.Contains("application/json", serializerKeys); + Assert.Contains("application/json", deserializerKeys);// Serializer and deserializer present for application/json + + Assert.Contains("text/plain", serializerKeys); + Assert.Contains("text/plain", deserializerKeys);// Serializer and deserializer present for text/plain + + Assert.Contains("application/x-www-form-urlencoded", serializerKeys); + Assert.Contains("application/x-www-form-urlencoded", deserializerKeys);// Serializer and deserializer present for application/x-www-form-urlencoded + + Assert.Contains("multipart/form-data", serializerKeys);// Serializer present for multipart/form-data + } + } +} diff --git a/tests/bundle/Microsoft.Kiota.Bundle.Tests.csproj b/tests/bundle/Microsoft.Kiota.Bundle.Tests.csproj new file mode 100644 index 00000000..d3bb6af6 --- /dev/null +++ b/tests/bundle/Microsoft.Kiota.Bundle.Tests.csproj @@ -0,0 +1,33 @@ + + + + true + net8.0;net462 + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + \ No newline at end of file diff --git a/tests/serialization/text/UnitTest1.cs b/tests/serialization/text/UnitTest1.cs deleted file mode 100644 index af7f54cc..00000000 --- a/tests/serialization/text/UnitTest1.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Xunit; - -namespace Microsoft.Kiota.Serialization.Text.Tests; - -public class UnitTest1 -{ - [Fact] - public void Test1() - { - - } -} \ No newline at end of file From 0ae7f29e6f6131c1a2d70c18ec950a30ba532afc Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Tue, 16 Jul 2024 15:16:31 +0300 Subject: [PATCH 02/11] Fix version typo --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a6401c4..c2762c8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -## [1.9.9] - 2024-07-17 +## [1.10.0] - 2024-07-17 - Adds Kiota bundle package to provide default adapter with registrations setup. [#290](https://github.com/microsoft/kiota-dotnet/issues/290) From 112123f7a0aab730c2f6bf50b0168a58ef915a83 Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Tue, 16 Jul 2024 15:18:59 +0300 Subject: [PATCH 03/11] format --- src/bundle/KiotaRequestAdapter.cs | 2 +- tests/bundle/BundleTests.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bundle/KiotaRequestAdapter.cs b/src/bundle/KiotaRequestAdapter.cs index fadb4e5e..5862698d 100644 --- a/src/bundle/KiotaRequestAdapter.cs +++ b/src/bundle/KiotaRequestAdapter.cs @@ -32,7 +32,7 @@ public KiotaRequestAdapter(IAuthenticationProvider authenticationProvider, IPars SetupDefaults(); } - private static void SetupDefaults() + private static void SetupDefaults() { // Setup the default serializers/deserializers ApiClientBuilder.RegisterDefaultSerializer(); diff --git a/tests/bundle/BundleTests.cs b/tests/bundle/BundleTests.cs index 34f18330..c56ed7ea 100644 --- a/tests/bundle/BundleTests.cs +++ b/tests/bundle/BundleTests.cs @@ -1,8 +1,8 @@ -using Xunit; -using Moq; -using System; +using System; using Microsoft.Kiota.Abstractions.Authentication; using Microsoft.Kiota.Abstractions.Serialization; +using Moq; +using Xunit; namespace Microsoft.Kiota.Bundle.Tests { From ddf7913ca0a32c416fe5d6b1b6c60c84089cfb2b Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Tue, 16 Jul 2024 15:27:56 +0300 Subject: [PATCH 04/11] No need to include identity lib. --- src/bundle/Microsoft.Kiota.Bundle.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/src/bundle/Microsoft.Kiota.Bundle.csproj b/src/bundle/Microsoft.Kiota.Bundle.csproj index 2f9bcbf0..b5bd3e1c 100644 --- a/src/bundle/Microsoft.Kiota.Bundle.csproj +++ b/src/bundle/Microsoft.Kiota.Bundle.csproj @@ -11,7 +11,6 @@ - From 425acbd2f91d2263873e41ae3c267326d852a268 Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Tue, 16 Jul 2024 15:31:59 +0300 Subject: [PATCH 05/11] Fix coverage info --- .github/workflows/sonarcloud.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index d041fd40..f11beac3 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -62,7 +62,7 @@ jobs: CoverletOutputFormat: "opencover" # https://github.com/microsoft/vstest/issues/4014#issuecomment-1307913682 shell: pwsh run: | - dotnet tool run dotnet-sonarscanner begin /k:"microsoft_kiota-abstractions-dotnet" /o:"microsoft" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="tests/abstractions/coverage.net8.0.opencover.xml,tests/authentication/azure/coverage.net8.0.opencover.xml,tests/http/httpClient/coverage.net8.0.opencover.xml,tests/serialization/json/coverage.net8.0.opencover.xml,tests/serialization/text/coverage.net8.0.opencover.xml,tests/serialization/form/coverage.net8.0.opencover.xml,tests/serialization/multipart/coverage.net8.0.opencover.xml" + dotnet tool run dotnet-sonarscanner begin /k:"microsoft_kiota-abstractions-dotnet" /o:"microsoft" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="tests/abstractions/coverage.net8.0.opencover.xml,tests/authentication/azure/coverage.net8.0.opencover.xml,tests/http/httpClient/coverage.net8.0.opencover.xml,tests/serialization/json/coverage.net8.0.opencover.xml,tests/serialization/text/coverage.net8.0.opencover.xml,tests/serialization/form/coverage.net8.0.opencover.xml,tests/serialization/multipart/coverage.net8.0.opencover.xml,tests/bundle/coverage.net8.0.opencover.xml" dotnet workload restore dotnet build dotnet test Microsoft.Kiota.sln --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --framework net8.0 From 5f8ca006931504e4e2d6f8769b02ccb8e6bebd2d Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Tue, 16 Jul 2024 16:16:56 +0300 Subject: [PATCH 06/11] Namespace aligns with package name --- src/bundle/KiotaRequestAdapter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bundle/KiotaRequestAdapter.cs b/src/bundle/KiotaRequestAdapter.cs index 5862698d..62c7513f 100644 --- a/src/bundle/KiotaRequestAdapter.cs +++ b/src/bundle/KiotaRequestAdapter.cs @@ -12,7 +12,7 @@ using Microsoft.Kiota.Serialization.Multipart; using Microsoft.Kiota.Serialization.Text; -namespace Microsoft.Kiota +namespace Microsoft.Kiota.Bundle { /// /// The implementation that derived from with registrations configured. From 4aede60d68aa99c8a0c2aa213701e5161f4381eb Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Mon, 22 Jul 2024 10:51:33 +0300 Subject: [PATCH 07/11] Cleans up documentation stuff --- src/bundle/KiotaRequestAdapter.cs | 12 ++++++------ src/bundle/README.md | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/bundle/KiotaRequestAdapter.cs b/src/bundle/KiotaRequestAdapter.cs index 62c7513f..5c8d73af 100644 --- a/src/bundle/KiotaRequestAdapter.cs +++ b/src/bundle/KiotaRequestAdapter.cs @@ -20,13 +20,13 @@ namespace Microsoft.Kiota.Bundle public class KiotaRequestAdapter : HttpClientRequestAdapter { /// - /// + /// Initializes a new instance of the class. /// - /// - /// - /// - /// - /// + /// The authentication provider. + /// The parse node factory. + /// The serialization writer factory. + /// The native HTTP client. + /// The observability options. public KiotaRequestAdapter(IAuthenticationProvider authenticationProvider, IParseNodeFactory? parseNodeFactory = null, ISerializationWriterFactory? serializationWriterFactory = null, HttpClient? httpClient = null, ObservabilityOptions? observabilityOptions = null) : base(authenticationProvider, parseNodeFactory, serializationWriterFactory, httpClient, observabilityOptions) { SetupDefaults(); diff --git a/src/bundle/README.md b/src/bundle/README.md index 7eb6413b..d038517e 100644 --- a/src/bundle/README.md +++ b/src/bundle/README.md @@ -1,6 +1,7 @@ # Kiota Bundle Library for dotnet -The Kiota Bundle Library for dotnet is the dotnet library providing default implementations for client setup. +The Kiota Bundle Library for dotnet is the dotnet library providing default implementations for client setup. +The package provides a request adapter implementation with defaults serialization libraries setup fo use with a generated Kiota client. Read more about Kiota [here](https://github.com/microsoft/kiota/blob/main/README.md). From 02e8afa37c3fa3fb0f14c67a780ad56602090c66 Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Tue, 23 Jul 2024 10:06:09 +0300 Subject: [PATCH 08/11] Rename to DefaultRequestAdapter --- .../{KiotaRequestAdapter.cs => DefaultRequestAdapter.cs} | 6 +++--- tests/bundle/BundleTests.cs | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) rename src/bundle/{KiotaRequestAdapter.cs => DefaultRequestAdapter.cs} (80%) diff --git a/src/bundle/KiotaRequestAdapter.cs b/src/bundle/DefaultRequestAdapter.cs similarity index 80% rename from src/bundle/KiotaRequestAdapter.cs rename to src/bundle/DefaultRequestAdapter.cs index 5c8d73af..c4fd6a3c 100644 --- a/src/bundle/KiotaRequestAdapter.cs +++ b/src/bundle/DefaultRequestAdapter.cs @@ -17,17 +17,17 @@ namespace Microsoft.Kiota.Bundle /// /// The implementation that derived from with registrations configured. /// - public class KiotaRequestAdapter : HttpClientRequestAdapter + public class DefaultRequestAdapter : HttpClientRequestAdapter { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The authentication provider. /// The parse node factory. /// The serialization writer factory. /// The native HTTP client. /// The observability options. - public KiotaRequestAdapter(IAuthenticationProvider authenticationProvider, IParseNodeFactory? parseNodeFactory = null, ISerializationWriterFactory? serializationWriterFactory = null, HttpClient? httpClient = null, ObservabilityOptions? observabilityOptions = null) : base(authenticationProvider, parseNodeFactory, serializationWriterFactory, httpClient, observabilityOptions) + public DefaultRequestAdapter(IAuthenticationProvider authenticationProvider, IParseNodeFactory? parseNodeFactory = null, ISerializationWriterFactory? serializationWriterFactory = null, HttpClient? httpClient = null, ObservabilityOptions? observabilityOptions = null) : base(authenticationProvider, parseNodeFactory, serializationWriterFactory, httpClient, observabilityOptions) { SetupDefaults(); } diff --git a/tests/bundle/BundleTests.cs b/tests/bundle/BundleTests.cs index c56ed7ea..addbe50e 100644 --- a/tests/bundle/BundleTests.cs +++ b/tests/bundle/BundleTests.cs @@ -1,7 +1,6 @@ using System; using Microsoft.Kiota.Abstractions.Authentication; using Microsoft.Kiota.Abstractions.Serialization; -using Moq; using Xunit; namespace Microsoft.Kiota.Bundle.Tests @@ -11,7 +10,7 @@ public class BundleTests [Fact] public void ThrowsArgumentNullExceptionOnNullAuthenticationProvider() { - var exception = Assert.Throws(() => new KiotaRequestAdapter(null!)); + var exception = Assert.Throws(() => new DefaultRequestAdapter(null!)); Assert.Equal("authenticationProvider", exception.ParamName); } @@ -19,7 +18,7 @@ public void ThrowsArgumentNullExceptionOnNullAuthenticationProvider() public void SerializersAreRegisteredAsExpected() { // setup - KiotaRequestAdapter requestAdapter = new KiotaRequestAdapter(new AnonymousAuthenticationProvider()); + _ = new DefaultRequestAdapter(new AnonymousAuthenticationProvider()); // validate var serializerCount = SerializationWriterFactoryRegistry.DefaultInstance.ContentTypeAssociatedFactories.Count; From 56c4c723cab93ff5769df1104eb68f47beab116d Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Mon, 29 Jul 2024 11:36:42 +0300 Subject: [PATCH 09/11] Update src/bundle/README.md --- src/bundle/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bundle/README.md b/src/bundle/README.md index d038517e..f6fcd76d 100644 --- a/src/bundle/README.md +++ b/src/bundle/README.md @@ -5,7 +5,7 @@ The package provides a request adapter implementation with defaults serializatio Read more about Kiota [here](https://github.com/microsoft/kiota/blob/main/README.md). -## Using the Abstractions Library +## Using the BundleLibrary ```shell dotnet add package Microsoft.Kiota.Bundle From 36f688c0acbcdfa50f948e18977d8e9642bf8df6 Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Mon, 29 Jul 2024 11:37:03 +0300 Subject: [PATCH 10/11] Update src/bundle/README.md --- src/bundle/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bundle/README.md b/src/bundle/README.md index f6fcd76d..ad4e8708 100644 --- a/src/bundle/README.md +++ b/src/bundle/README.md @@ -5,7 +5,7 @@ The package provides a request adapter implementation with defaults serializatio Read more about Kiota [here](https://github.com/microsoft/kiota/blob/main/README.md). -## Using the BundleLibrary +## Using the Bundle Library ```shell dotnet add package Microsoft.Kiota.Bundle From 443672e02b17e5b18cffefaaf104d0c52f5c1023 Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Tue, 30 Jul 2024 10:46:38 +0300 Subject: [PATCH 11/11] Update main readme to include link to bundle. --- README.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ef2d6a29..b0ed0284 100644 --- a/README.md +++ b/README.md @@ -12,15 +12,16 @@ Read more about Kiota [here](https://github.com/microsoft/kiota/blob/main/README ## Libraries -| Library | Nuget Release | -| ------ | ------ | -| [Abstractions](./src/abstractions/README.md) | [![NuGet Version](https://buildstats.info/nuget/Microsoft.Kiota.Abstractions?includePreReleases=true)](https://www.nuget.org/packages/Microsoft.Kiota.Abstractions/) | -| [Authentication - Azure](./src/authentication/azure/README.md) | [![NuGet Version](https://buildstats.info/nuget/Microsoft.Kiota.Authentication.Azure?includePreReleases=true)](https://www.nuget.org/packages/Microsoft.Kiota.Authentication.Azure/) | -| [Http - HttpClientLibrary](./src/http/httpClient/README.md) | [![NuGet Version](https://buildstats.info/nuget/Microsoft.Kiota.Http.HttpClientLibrary?includePreReleases=true)](https://www.nuget.org/packages/Microsoft.Kiota.Http.HttpClientLibrary/) | -| [Serialization - JSON](./src/serialization/json/README.md) | [![NuGet Version](https://buildstats.info/nuget/Microsoft.Kiota.Serialization.Json?includePreReleases=true)](https://www.nuget.org/packages/Microsoft.Kiota.Serialization.Json/) | -| [Serialization - FORM](./src/serialization/form/README.md) | [![NuGet Version](https://buildstats.info/nuget/Microsoft.Kiota.Serialization.Form?includePreReleases=true)](https://www.nuget.org/packages/Microsoft.Kiota.Serialization.Form/) | -| [Serialization - TEXT](./src/serialization/text/README.md) | [![NuGet Version](https://buildstats.info/nuget/Microsoft.Kiota.Serialization.Text?includePreReleases=true)](https://www.nuget.org/packages/Microsoft.Kiota.Serialization.Text/) | +| Library | Nuget Release | +|----------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [Abstractions](./src/abstractions/README.md) | [![NuGet Version](https://buildstats.info/nuget/Microsoft.Kiota.Abstractions?includePreReleases=true)](https://www.nuget.org/packages/Microsoft.Kiota.Abstractions/) | +| [Authentication - Azure](./src/authentication/azure/README.md) | [![NuGet Version](https://buildstats.info/nuget/Microsoft.Kiota.Authentication.Azure?includePreReleases=true)](https://www.nuget.org/packages/Microsoft.Kiota.Authentication.Azure/) | +| [Http - HttpClientLibrary](./src/http/httpClient/README.md) | [![NuGet Version](https://buildstats.info/nuget/Microsoft.Kiota.Http.HttpClientLibrary?includePreReleases=true)](https://www.nuget.org/packages/Microsoft.Kiota.Http.HttpClientLibrary/) | +| [Serialization - JSON](./src/serialization/json/README.md) | [![NuGet Version](https://buildstats.info/nuget/Microsoft.Kiota.Serialization.Json?includePreReleases=true)](https://www.nuget.org/packages/Microsoft.Kiota.Serialization.Json/) | +| [Serialization - FORM](./src/serialization/form/README.md) | [![NuGet Version](https://buildstats.info/nuget/Microsoft.Kiota.Serialization.Form?includePreReleases=true)](https://www.nuget.org/packages/Microsoft.Kiota.Serialization.Form/) | +| [Serialization - TEXT](./src/serialization/text/README.md) | [![NuGet Version](https://buildstats.info/nuget/Microsoft.Kiota.Serialization.Text?includePreReleases=true)](https://www.nuget.org/packages/Microsoft.Kiota.Serialization.Text/) | | [Serialization - MULTIPART](./src/serialization/multipart/README.md) | [![NuGet Version](https://buildstats.info/nuget/Microsoft.Kiota.Serialization.Multipart?includePreReleases=true)](https://www.nuget.org/packages/Microsoft.Kiota.Serialization.Multipart/) | +| [Bundle](./src/bundle/README.md) | [![NuGet Version](https://buildstats.info/nuget/Microsoft.Kiota.Bundle?includePreReleases=true)](https://www.nuget.org/packages/Microsoft.Kiota.Bundle/) | ## Release notes