diff --git a/.vscode/settings.json b/.vscode/settings.json index 85f9ce0..0624635 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,5 +2,8 @@ "cSpell.spellCheckOnlyWorkspaceFiles": true, "markdownlint.ignore": [ "LICENSE-CODE" - ] + ], + "cSpell.words": [ + "kiota" + ] } diff --git a/OpenAPI/kiota/dependencies.md b/OpenAPI/kiota/dependencies.md new file mode 100644 index 0000000..b605235 --- /dev/null +++ b/OpenAPI/kiota/dependencies.md @@ -0,0 +1,206 @@ +--- +title: Managing dependencies of Kiota API clients +description: Learn what different dependencies bring to your project and how to manage them. +author: baywet +ms.author: vibiret +ms.topic: conceptual +date: 03/21/2023 +--- + +# Managing dependencies of Kiota API clients + +Kiota clients require multiple dependencies to function properly. In this documentation page you'll find details about each dependency, which package to use in each language and guidance on how to properly manage these dependencies for your application. + +## Guidance + +### Generated client and dependencies versions alignment + +For the best experience, after generating or updating a client, always ensure the kiota dependencies are aligned with the versions recommended by the info command. + +[More information about the info command](./using.md#language-information) + +### Dependencies selection + +In most cases, the [bundle](#bundle) package and any [additionally required package](#additional) for the language you are using will bring most dependencies your application needs. + +If your application requires a specific [HTTP](#http) client, [serialization](#serialization) library or format, you'll need to at least add the abstractions and additionally required dependencies for the language you're using. Additionally, you can select default implementations for HTTP and serialization packages, or swap them for third party or your own implementations. + +Additionally, your application might need to reference an [authentication](#authentication) package depending on the target API. + +## Abstractions + +Any Kiota generated API client relies on a set of abstractions as a build and runtime dependency, the application will require this dependency after a new client is generated. + +[More information about the abstractions package](./abstractions.md) + +The following table provides the list of abstractions package per language. + +| Language | Package Name | +| -------- | ------------ | +| C# | Microsoft.Kiota.Abstractions | +| CLI | Microsoft.Kiota.Abstractions | +| Go | github.com/microsoft/kiota-abstractions-go | +| Java | com.microsoft.kiota:microsoft-kiota-abstractions | +| PHP | microsoft/kiota-abstractions | +| Python | microsoft-kiota-abstractions | +| Ruby | microsoft_kiota_abstractions | +| Swift | Not released | +| TypeScript | @microsoft/kiota-abstractions | + +## Serialization + +Kiota provides default implementation for diverse serialization formats. These dependencies are required at runtime. Depending the the application requirements those implementations can be used as is, swapped or augmented with implementations from the application, or swapped with third party implementations. + +[More information about the serialization packages](./serialization.md) + +### JSON + +Media type: application/json + +The following table provides the list of serialization package per language. + +| Language | Package Name | Relies on | +| -------- | ------------ | --------- | +| C# | Microsoft.Kiota.Serialization.Json | System.Text.Json | +| CLI | Microsoft.Kiota.Serialization.Json | System.Text.Json | +| Go | github.com/microsoft/kiota-serialization-json-go | None | +| Java | com.microsoft.kiota:microsoft-kiota-serialization-json | Gson | +| PHP | microsoft/kiota-serialization-json | None | +| Python | microsoft-kiota-serialization-json | None | +| Ruby | microsoft_kiota_serialization_json | None | +| Swift | Not released | None | +| TypeScript | @microsoft/kiota-serialization-json | None | + +### Multipart + +Media type: multipart/form-data + +The following table provides the list of serialization package per language. + +| Language | Package Name | Relies on | +| -------- | ------------ | --------- | +| C# | Microsoft.Kiota.Serialization.Multipart | None | +| CLI | Microsoft.Kiota.Serialization.Multipart | None | +| Go | github.com/microsoft/kiota-serialization-multipart-go | None | +| Java | com.microsoft.kiota:microsoft-kiota-serialization-multipart | None | +| PHP | microsoft/kiota-serialization-multipart | None | +| Python | microsoft-kiota-serialization-multipart | None | +| Ruby | Not released | None | +| Swift | Not released | None | +| TypeScript | @microsoft/kiota-serialization-multipart | None | + +### Form + +Media type: application/x-www-form-urlencoded + +The following table provides the list of serialization package per language. + +| Language | Package Name | Relies on | +| -------- | ------------ | --------- | +| C# | Microsoft.Kiota.Serialization.Form | None | +| CLI | Microsoft.Kiota.Serialization.Form | None | +| Go | github.com/microsoft/kiota-serialization-form-go | None | +| Java | com.microsoft.kiota:microsoft-kiota-serialization-form | None | +| PHP | microsoft/kiota-serialization-form | None | +| Python | microsoft-kiota-serialization-form | None | +| Ruby | Not Released | None | +| Swift | Not released | None | +| TypeScript | @microsoft/kiota-serialization-form | None | + +### Text + +Media type: text/plain + +The following table provides the list of serialization package per language. + +| Language | Package Name | Relies on | +| -------- | ------------ | --------- | +| C# | Microsoft.Kiota.Serialization.Text | None | +| CLI | Microsoft.Kiota.Serialization.Text | None | +| Go | github.com/microsoft/kiota-serialization-text-go | None | +| Java | com.microsoft.kiota:microsoft-kiota-serialization-text | None | +| PHP | microsoft/kiota-serialization-text | None | +| Python | microsoft-kiota-serialization-text | None | +| Ruby | Not Released | None | +| Swift | Not released | None | +| TypeScript | @microsoft/kiota-serialization-text | None | + +## Http + +Kiota provides a default request adapter implementation to convert abstract request information objects created by the generated fluent API to HTTP requests. This dependency is required at runtime. Depending the the application requirements this implementation can be used as is, swapped with another implementation from the application, or swapped with a third party implementation. + +[More information about the HTTP package](./middleware.md). + +The following table provides the list of HTTP package per language. + +| Language | Package Name | Relies on | +| -------- | ------------ | --------- | +| C# | Microsoft.Kiota.Http.HttpClientLibrary | System.Net.Http | +| CLI | Microsoft.Kiota.Http.HttpClientLibrary | System.Net.Http | +| Go | github.com/microsoft/kiota-http-go | net/http | +| Java | com.microsoft.kiota:microsoft-kiota-http-okHttp | None | +| PHP | microsoft/kiota-http-guzzle | None | +| Python | microsoft-kiota-http | None | +| Ruby | microsoft_kiota_faraday | None | +| Swift | Not released | None | +| TypeScript | @microsoft/kiota-http-fetchlibrary | None | + +## Authentication + +Depending on authentication requirements from the target REST APIs, your application might additionally need an authentication dependency. Kiota provides default implementation providers for specific scenarios. Depending the the application requirements those implementations can be used as is, swapped or augmented with implementations from the application, or swapped with third party implementations. + +[More information about the authentication package](./authentication.md) + +### Azure Identity + +These providers might be used for any API secured with Bearer token authorization for which the identity platform is Entra Identity/Microsoft Identity Platform/Azure Identity/Azure Active Directory. + +The following table provides the list of authentication package per language. + +| Language | Package Name | Relies on | +| -------- | ------------ | --------- | +| C# | Microsoft.Kiota.Authentication.Azure | Azure.Identity | +| CLI | Microsoft.Kiota.Authentication.Azure | Azure.Identity | +| Go | github.com/microsoft/kiota-authentication-azure-go | github.com/Azure/azure-sdk-for-go/sdk/azidentity | +| Java | com.microsoft.kiota:microsoft-kiota-authentication-azure | com.azure:azure-identity | +| PHP | microsoft/kiota-authentication-phpleague | phpleague | +| Python | microsoft-kiota-authentication-azure | azure-identity | +| Ruby | microsoft_kiota_authentication_oauth | oauth | +| Swift | Not released | None | +| TypeScript | @microsoft/kiota-authentication-azure | @azure/identity | + +## Additional + +Additional dependencies are required at build time and/or runtime. + +The following table provides the list of additional package per language. + +| Language | Package Name | Type | +| -------- | ------------ | ---- | +| C# | None | | +| CLI | Microsoft.Kiota.CLI.Commons, System.CommandLine | Build and runtime | +| Go | None | | +| Java | jakarta.annotation:jakarta.annotation-api:2.0.0 | Build | +| PHP | None | | +| Python | None | | +| Ruby | None | | +| Swift | None | | +| TypeScript | None | | + +## Bundle + +To simplify dependencies management, kiota now offers bundles which contains abstractions, the default serialization implementations, and the default http implementation. Bundle packages can be used as an alternative to adding references to those packages. + +The following table provides the list of bundle package per language. + +| Language | Package Name | +| -------- | ------------ | +| C# | Microsoft.Kiota.Bundle | +| CLI | Microsoft.Kiota.Bundle | +| Go | github.com/microsoft/kiota-bundle-go | +| Java | com.microsoft.kiota:microsoft-kiota-bundle | +| PHP | Not available | +| Python | Not available | +| Ruby | Not available | +| Swift | Not available | +| TypeScript | @microsoft/kiota-bundle | diff --git a/OpenAPI/kiota/quickstarts/cli.md b/OpenAPI/kiota/quickstarts/cli.md index 6620804..fb665b6 100644 --- a/OpenAPI/kiota/quickstarts/cli.md +++ b/OpenAPI/kiota/quickstarts/cli.md @@ -38,26 +38,15 @@ In case you're adding a Kiota client to an existing project, the following confi ## Add dependencies -Before you can compile and run the generated API client, you need to make sure the generated source files are part of a project with the required dependencies. Your project must have a reference to the [abstraction package](https://github.com/microsoft/kiota-abstractions-dotnet) and the [cli-commons package](https://github.com/microsoft/kiota-cli-commons). Additionally, you must either use the Kiota default implementations or provide your own custom implementations of the following packages. - -- HTTP ([Kiota default HttpClient-based implementation](https://github.com/microsoft/kiota-http-dotnet)) -- Form serialization ([Kiota default](https://github.com/microsoft/kiota-serialization-form-dotnet)) -- JSON serialization ([Kiota default](https://github.com/microsoft/kiota-serialization-json-dotnet)) -- Text serialization ([Kiota default](https://github.com/microsoft/kiota-serialization-text-dotnet)) -- Multipart serialization ([Kiota default](https://github.com/microsoft/kiota-serialization-multipart-dotnet)) +Before you can compile and run the generated API client, you need to make sure the generated source files are part of a project with the required dependencies. Your project must have a reference to the [bundle package](https://github.com/microsoft/kiota-dotnet) and the [cli-commons package](https://github.com/microsoft/kiota-cli-commons). For more information about kiota dependencies, refer to [the dependencies documentation](../dependencies.md). For this tutorial, use the default implementations. Run the following commands to get the required dependencies. ```bash -dotnet add package Microsoft.Kiota.Abstractions +dotnet add package Microsoft.Kiota.Bundle dotnet add package Microsoft.Kiota.Cli.Commons --prerelease -dotnet add package Microsoft.Kiota.Http.HttpClientLibrary -dotnet add package Microsoft.Kiota.Serialization.Form -dotnet add package Microsoft.Kiota.Serialization.Json -dotnet add package Microsoft.Kiota.Serialization.Text -dotnet add package Microsoft.Kiota.Serialization.Multipart ``` ## Generate the API client diff --git a/OpenAPI/kiota/quickstarts/dotnet.md b/OpenAPI/kiota/quickstarts/dotnet.md index a4466c9..39d5608 100644 --- a/OpenAPI/kiota/quickstarts/dotnet.md +++ b/OpenAPI/kiota/quickstarts/dotnet.md @@ -37,25 +37,12 @@ The following configuration is recommended: ## Add dependencies -Before you can compile and run the generated API client, you need to make sure the generated source files are part of a project with the required dependencies. Your project must have a reference to the [abstraction package](https://github.com/microsoft/kiota-abstractions-dotnet). Additionally, you must either use the Kiota default implementations or provide your own custom implementations of the following packages. - -- HTTP ([Kiota default HttpClient-based implementation](https://github.com/microsoft/kiota-http-dotnet)) -- Form serialization ([Kiota default](https://github.com/microsoft/kiota-serialization-form-dotnet)) -- JSON serialization ([Kiota default](https://github.com/microsoft/kiota-serialization-json-dotnet)) -- Text serialization ([Kiota default](https://github.com/microsoft/kiota-serialization-text-dotnet)) -- Multipart serialization ([Kiota default](https://github.com/microsoft/kiota-serialization-multipart-dotnet)) - -For this tutorial, use the default implementations. +Before you can compile and run the generated API client, you need to make sure the generated source files are part of a project with the required dependencies. Your project must have a reference to the [bundle package](https://github.com/microsoft/kiota-dotnet). For more information about kiota dependencies, refer to [the dependencies documentation](../dependencies.md). Run the following commands to get the required dependencies. ```bash -dotnet add package Microsoft.Kiota.Abstractions -dotnet add package Microsoft.Kiota.Http.HttpClientLibrary -dotnet add package Microsoft.Kiota.Serialization.Form -dotnet add package Microsoft.Kiota.Serialization.Json -dotnet add package Microsoft.Kiota.Serialization.Text -dotnet add package Microsoft.Kiota.Serialization.Multipart +dotnet add package Microsoft.Kiota.Bundle ``` ## Generate the API client diff --git a/OpenAPI/kiota/quickstarts/go.md b/OpenAPI/kiota/quickstarts/go.md index 857a631..2cc017f 100644 --- a/OpenAPI/kiota/quickstarts/go.md +++ b/OpenAPI/kiota/quickstarts/go.md @@ -31,25 +31,12 @@ In case you're adding a Kiota client to an existing project, the following confi ## Add dependencies -Before you can compile and run the generated API client, you need to make sure the generated source files are part of a project with the required dependencies. Your project must have a reference to the [abstraction package](https://github.com/microsoft/kiota-abstractions-go). Additionally, you must either use the Kiota default implementations or provide your own custom implementations of the following packages. - -- HTTP ([Kiota default net/http-based implementation](https://github.com/microsoft/kiota-http-go)) -- Form serialization ([Kiota default](https://github.com/microsoft/kiota-serialization-form-go)) -- JSON serialization ([Kiota default](https://github.com/microsoft/kiota-serialization-json-go)) -- Text serialization ([Kiota default](https://github.com/microsoft/kiota-serialization-text-go)) -- Multipart serialization ([Kiota default](https://github.com/microsoft/kiota-serialization-multipart-go)) - -For this tutorial, use the default implementations. +Before you can compile and run the generated API client, you need to make sure the generated source files are part of a project with the required dependencies. Your project must have a reference to the [bundle package](https://github.com/microsoft/kiota-bundle-go). For more information about kiota dependencies, refer to [the dependencies documentation](../dependencies.md). Run the following commands to get the required dependencies. ```bash -go get github.com/microsoft/kiota-abstractions-go -go get github.com/microsoft/kiota-http-go -go get github.com/microsoft/kiota-serialization-form-go -go get github.com/microsoft/kiota-serialization-json-go -go get github.com/microsoft/kiota-serialization-text-go -go get github.com/microsoft/kiota-serialization-multipart-go +go get github.com/microsoft/kiota-bundle-go ``` ## Generate the API client diff --git a/OpenAPI/kiota/quickstarts/java.md b/OpenAPI/kiota/quickstarts/java.md index 6c12ff2..e0df328 100644 --- a/OpenAPI/kiota/quickstarts/java.md +++ b/OpenAPI/kiota/quickstarts/java.md @@ -34,16 +34,7 @@ In case you're adding a Kiota client to an existing project, the following confi ## Add dependencies -Before you can compile and run the generated API client, you need to make sure the generated source files are part of a project with the required dependencies. Your project must have a reference to the [abstraction package](https://github.com/microsoft/kiota-java). Additionally, you must either use the Kiota default implementations or provide your own custom implementations of the following packages. - -- HTTP ([Kiota default OkHttp-based implementation](https://github.com/microsoft/kiota-java)) -- Form serialization ([Kiota default](https://github.com/microsoft/kiota-java)) -- JSON serialization ([Kiota default](https://github.com/microsoft/kiota-java)) -- Text serialization ([Kiota default](https://github.com/microsoft/kiota-java)) -- Multipart serialization ([Kiota default](https://github.com/microsoft/kiota-java)) -- Jakarta annotations [Maven Central](https://central.sonatype.com/artifact/jakarta.annotation/jakarta.annotation-api) - -For this tutorial, use the default implementations. +Before you can compile and run the generated API client, you need to make sure the generated source files are part of a project with the required dependencies. Your project must have a reference to the [bundle package](https://github.com/microsoft/kiota-java). For more information about kiota dependencies, refer to [the dependencies documentation](../dependencies.md). Edit **./app/build.gradle** to add the following dependencies. @@ -63,7 +54,7 @@ This file is a minimal OpenAPI description that describes how to call the `/post You can then use the Kiota command line tool to generate the API client classes. ```bash -kiota generate -l java -c PostsClient -n kiotaposts.client -d ./posts-api.yml -o ./app/src/main/java/kiotaposts/client +kiota generate -l java -c PostsClient -n kiotaposts.client -d ./posts-api.yml -o ./app/src/main/java/kiotaposts/client --ds none -s none ``` > [!TIP] diff --git a/OpenAPI/kiota/quickstarts/typescript.md b/OpenAPI/kiota/quickstarts/typescript.md index 635df38..1bfda79 100644 --- a/OpenAPI/kiota/quickstarts/typescript.md +++ b/OpenAPI/kiota/quickstarts/typescript.md @@ -39,25 +39,12 @@ In case you're adding a Kiota client to an existing project, the following confi ## Add dependencies -Before you can compile and run the generated API client, you need to make sure the generated source files are part of a project with the required dependencies. Your project must have a reference to the [abstraction package](https://www.npmjs.com/package/@microsoft/kiota-abstractions). Additionally, you must either use the Kiota default implementations or provide your own custom implementations of the following packages. - -- HTTP ([Kiota default fetch-based implementation](https://www.npmjs.com/package/@microsoft/kiota-http-fetchlibrary)) -- Form serialization ([Kiota default](https://www.npmjs.com/package/@microsoft/kiota-serialization-form)) -- JSON serialization ([Kiota default](https://www.npmjs.com/package/@microsoft/kiota-serialization-json)) -- Text serialization ([Kiota default](https://www.npmjs.com/package/@microsoft/kiota-serialization-text)) -- Multipart serialization ([Kiota default](https://www.npmjs.com/package/@microsoft/kiota-serialization-multipart)) - -For this tutorial, use the default implementations. +Before you can compile and run the generated API client, you need to make sure the generated source files are part of a project with the required dependencies. Your project must have a reference to the [bundle package](https://github.com/microsoft/kiota-typescript). For more information about kiota dependencies, refer to [the dependencies documentation](../dependencies.md). Run the following commands to get the required dependencies. ```bash -npm install @microsoft/kiota-abstractions -npm install @microsoft/kiota-http-fetchlibrary -npm install @microsoft/kiota-serialization-form -npm install @microsoft/kiota-serialization-json -npm install @microsoft/kiota-serialization-text -npm install @microsoft/kiota-serialization-multipart +npm install @microsoft/kiota-bundle ``` ## Generate the API client diff --git a/OpenAPI/kiota/toc.yml b/OpenAPI/kiota/toc.yml index 9a7035a..279586c 100644 --- a/OpenAPI/kiota/toc.yml +++ b/OpenAPI/kiota/toc.yml @@ -49,6 +49,8 @@ items: items: - name: Kiota design href: design.md + - name: Managing dependencies + href: dependencies.md - name: API client experience href: experience.md - name: Abstractions diff --git a/OpenAPI/kiota/tutorials/cli-azure.md b/OpenAPI/kiota/tutorials/cli-azure.md index bb10c47..61c159e 100644 --- a/OpenAPI/kiota/tutorials/cli-azure.md +++ b/OpenAPI/kiota/tutorials/cli-azure.md @@ -29,28 +29,13 @@ dotnet new gitignore ## Add dependencies -Before you can compile and run the generated API client, you need to make sure the generated source files are part of a project with the required dependencies. Your project must have a reference to the [abstraction package](https://github.com/microsoft/kiota-abstractions-dotnet) and the [cli-commons package](https://github.com/microsoft/kiota-cli-commons). Additionally, you must either use the Kiota default implementations or provide your own custom implementations of the following packages. - -- Authentication ([Kiota default Azure authentication](https://github.com/microsoft/kiota-authentication-azure-dotnet)) -- HTTP ([Kiota default HttpClient-based implementation](https://github.com/microsoft/kiota-http-dotnet)) -- Form serialization ([Kiota default](https://github.com/microsoft/kiota-serialization-form-dotnet)) -- JSON serialization ([Kiota default](https://github.com/microsoft/kiota-serialization-json-dotnet)) -- Text serialization ([Kiota default](https://github.com/microsoft/kiota-serialization-text-dotnet)) -- Multipart serialization ([Kiota default](https://github.com/microsoft/kiota-serialization-multipart-dotnet)) - -For this tutorial, use the default implementations. +Before you can compile and run the generated API client, you need to make sure the generated source files are part of a project with the required dependencies. Your project must have a reference to the [bundle package](https://github.com/microsoft/kiota-dotnet) and the [cli-commons package](https://github.com/microsoft/kiota-cli-commons). For more information about kiota dependencies, refer to [the dependencies documentation](../dependencies.md). Run the following commands to get the required dependencies. ```bash -dotnet add package Microsoft.Kiota.Abstractions +dotnet add package Microsoft.Kiota.Bundle dotnet add package Microsoft.Kiota.Cli.Commons --prerelease -dotnet add package Microsoft.Kiota.Http.HttpClientLibrary -dotnet add package Microsoft.Kiota.Serialization.Form -dotnet add package Microsoft.Kiota.Serialization.Json -dotnet add package Microsoft.Kiota.Serialization.Text -dotnet add package Microsoft.Kiota.Serialization.Multipart -dotnet add package Microsoft.Kiota.Authentication.Azure dotnet add package Azure.Identity dotnet add package Microsoft.Extensions.DependencyInjection dotnet add package Microsoft.Extensions.Hosting diff --git a/OpenAPI/kiota/tutorials/dotnet-azure.md b/OpenAPI/kiota/tutorials/dotnet-azure.md index d97d548..b0ab6d5 100644 --- a/OpenAPI/kiota/tutorials/dotnet-azure.md +++ b/OpenAPI/kiota/tutorials/dotnet-azure.md @@ -27,26 +27,12 @@ dotnet new gitignore ## Add dependencies -Before you can compile and run the generated API client, you need to make sure the generated source files are part of a project with the required dependencies. Your project must have a reference to the [abstraction package](https://github.com/microsoft/kiota-abstractions-dotnet). Additionally, you must either use the Kiota default implementations or provide your own custom implementations of the following packages. - -- Authentication ([Kiota default Azure authentication](https://github.com/microsoft/kiota-authentication-azure-dotnet)) -- HTTP ([Kiota default HttpClient-based implementation](https://github.com/microsoft/kiota-http-dotnet)) -- Form serialization ([Kiota default](https://github.com/microsoft/kiota-serialization-form-dotnet)) -- JSON serialization ([Kiota default](https://github.com/microsoft/kiota-serialization-json-dotnet)) -- Text serialization ([Kiota default](https://github.com/microsoft/kiota-serialization-text-dotnet)) -- Multipart serialization ([Kiota default](https://github.com/microsoft/kiota-serialization-multipart-dotnet)) - -For this tutorial, use the default implementations. +Before you can compile and run the generated API client, you need to make sure the generated source files are part of a project with the required dependencies. Your project must have a reference to the [bundle package](https://github.com/microsoft/kiota-dotnet). For more information about kiota dependencies, refer to [the dependencies documentation](../dependencies.md). Run the following commands to get the required dependencies. ```dotnetcli -dotnet add package Microsoft.Kiota.Abstractions -dotnet add package Microsoft.Kiota.Http.HttpClientLibrary -dotnet add package Microsoft.Kiota.Serialization.Form -dotnet add package Microsoft.Kiota.Serialization.Json -dotnet add package Microsoft.Kiota.Serialization.Text -dotnet add package Microsoft.Kiota.Serialization.Multipart +dotnet add package Microsoft.Kiota.Bundle dotnet add package Microsoft.Kiota.Authentication.Azure dotnet add package Azure.Identity ``` diff --git a/OpenAPI/kiota/tutorials/dotnet-dependency-injection.md b/OpenAPI/kiota/tutorials/dotnet-dependency-injection.md index 517718d..9310165 100644 --- a/OpenAPI/kiota/tutorials/dotnet-dependency-injection.md +++ b/OpenAPI/kiota/tutorials/dotnet-dependency-injection.md @@ -28,25 +28,13 @@ dotnet new gitignore ## Add dependencies -Before you can compile and run the generated API client, ensure the generated source files are part of a project with the required dependencies. Your project must reference the [abstraction package](https://github.com/microsoft/kiota-abstractions-dotnet) and default implementations. - -- HTTP ([Kiota default HttpClient-based implementation](https://github.com/microsoft/kiota-http-dotnet)) version `1.4.2` or higher -- JSON serialization ([Kiota default](https://github.com/microsoft/kiota-serialization-json-dotnet)) -- Form serialization ([Kiota default](https://github.com/microsoft/kiota-serialization-form-dotnet)) -- Text serialization ([Kiota default](https://github.com/microsoft/kiota-serialization-text-dotnet)) -- Multipart serialization ([Kiota default](https://github.com/microsoft/kiota-serialization-multipart-dotnet)) -- HttpClient support for Dependency Injection [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http) +Before you can compile and run the generated API client, ensure the generated source files are part of a project with the required dependencies. Your project must reference the [bundle package](https://github.com/microsoft/kiota-dotnet). For more information about kiota dependencies, refer to [the dependencies documentation](../dependencies.md). Run the following commands to get the required dependencies. ```dotnetcli dotnet add package Microsoft.Extensions.Http -dotnet add package Microsoft.Kiota.Abstractions -dotnet add package Microsoft.Kiota.Http.HttpClientLibrary -dotnet add package Microsoft.Kiota.Serialization.Json -dotnet add package Microsoft.Kiota.Serialization.Form -dotnet add package Microsoft.Kiota.Serialization.Text -dotnet add package Microsoft.Kiota.Serialization.Multipart +dotnet add package Microsoft.Kiota.Bundle ``` ## Generate the API client diff --git a/OpenAPI/kiota/tutorials/go-azure.md b/OpenAPI/kiota/tutorials/go-azure.md index 2315bfd..830f7bd 100644 --- a/OpenAPI/kiota/tutorials/go-azure.md +++ b/OpenAPI/kiota/tutorials/go-azure.md @@ -25,26 +25,12 @@ go mod init getuser ## Add dependencies -Before you can compile and run the generated API client, you need to make sure the generated source files are part of a project with the required dependencies. Your project must have a reference to the [abstraction package](https://github.com/microsoft/kiota-abstractions-go). Additionally, you must either use the Kiota default implementations or provide your own custom implementations of the following packages. - -- Authentication ([Kiota default Azure authentication](https://github.com/microsoft/kiota-authentication-azure-go)) -- HTTP ([Kiota default net/http-based implementation](https://github.com/microsoft/kiota-http-go)) -- Form serialization ([Kiota default](https://github.com/microsoft/kiota-serialization-form-go)) -- JSON serialization ([Kiota default](https://github.com/microsoft/kiota-serialization-json-go)) -- Text serialization ([Kiota default](https://github.com/microsoft/kiota-serialization-text-go)) -- Multipart serialization ([Kiota default](https://github.com/microsoft/kiota-serialization-multipart-go)) - -For this tutorial, use the default implementations. +Before you can compile and run the generated API client, you need to make sure the generated source files are part of a project with the required dependencies. Your project must have a reference to the [bundle package](https://github.com/microsoft/kiota-bundle-go). For more information about kiota dependencies, refer to [the dependencies documentation](../dependencies.md). Run the following commands to get the required dependencies. ```bash -go get github.com/microsoft/kiota-abstractions-go -go get github.com/microsoft/kiota-http-go -go get github.com/microsoft/kiota-serialization-form-go -go get github.com/microsoft/kiota-serialization-json-go -go get github.com/microsoft/kiota-serialization-text-go -go get github.com/microsoft/kiota-serialization-multipart-go +go get github.com/microsoft/kiota-bundle-go go get github.com/microsoft/kiota-authentication-azure-go go get github.com/Azure/azure-sdk-for-go/sdk/azidentity ``` diff --git a/OpenAPI/kiota/tutorials/java-azure.md b/OpenAPI/kiota/tutorials/java-azure.md index 0673140..529e6f6 100644 --- a/OpenAPI/kiota/tutorials/java-azure.md +++ b/OpenAPI/kiota/tutorials/java-azure.md @@ -24,15 +24,7 @@ gradle init --dsl groovy --test-framework junit --type java-application --projec ## Add dependencies -Before you can compile and run the generated API client, you need to make sure the generated source files are part of a project with the required dependencies. Your project must have a reference to the [abstraction package](https://github.com/microsoft/kiota-java). Additionally, you must either use the Kiota default implementations or provide your own custom implementations of the following packages. - -- Authentication ([Kiota default Azure authentication](https://github.com/microsoft/kiota-java)) -- HTTP ([Kiota default OkHttp-based implementation](https://github.com/microsoft/kiota-java)) -- Form serialization ([Kiota default](https://github.com/microsoft/kiota-java)) -- JSON serialization ([Kiota default](https://github.com/microsoft/kiota-java)) -- Text serialization ([Kiota default](https://github.com/microsoft/kiota-java)) -- Multipart serialization ([Kiota default](https://github.com/microsoft/kiota-java)) -- Jakarta annotations [Maven Central](https://central.sonatype.com/artifact/jakarta.annotation/jakarta.annotation-api) +Before you can compile and run the generated API client, you need to make sure the generated source files are part of a project with the required dependencies. Your project must have a reference to the [bundle package](https://github.com/microsoft/kiota-java). For more information about kiota dependencies, refer to [the dependencies documentation](../dependencies.md). For this tutorial, use the default implementations. @@ -52,7 +44,7 @@ Kiota generates API clients from OpenAPI documents. Create a file named **get-me You can then use the Kiota command line tool to generate the SDK classes. ```bash -kiota generate -l java -d get-me.yml -c GetUserApiClient -n getuserclient.apiclient -o ./app/src/main/java/getuserclient/apiclient +kiota generate -l java -d get-me.yml -c GetUserApiClient -n getuserclient.apiclient -o ./app/src/main/java/getuserclient/apiclient --ds none -s none ``` ## Register an application diff --git a/OpenAPI/kiota/tutorials/typescript-azure.md b/OpenAPI/kiota/tutorials/typescript-azure.md index 0b97a9a..c231ef0 100644 --- a/OpenAPI/kiota/tutorials/typescript-azure.md +++ b/OpenAPI/kiota/tutorials/typescript-azure.md @@ -26,27 +26,13 @@ npx tsc --init ## Add dependencies -Before you can compile and run the generated API client, you need to make sure the generated source files are part of a project with the required dependencies. Your project must have a reference to the [abstraction package](https://www.npmjs.com/package/@microsoft/kiota-abstractions). Additionally, you must either use the Kiota default implementations or provide your own custom implementations of the following packages. - -- Authentication ([Kiota default Azure authentication](https://www.npmjs.com/package/@microsoft/kiota-authentication-azure)) -- HTTP ([Kiota default fetch-based implementation](https://www.npmjs.com/package/@microsoft/kiota-http-fetchlibrary)) -- Form serialization ([Kiota default](https://www.npmjs.com/package/@microsoft/kiota-serialization-form)) -- JSON serialization ([Kiota default](https://www.npmjs.com/package/@microsoft/kiota-serialization-json)) -- Text serialization ([Kiota default](https://www.npmjs.com/package/@microsoft/kiota-serialization-text)) -- Multipart serialization ([Kiota default](https://www.npmjs.com/package/@microsoft/kiota-serialization-multipart)) - -For this tutorial, use the default implementations. +Before you can compile and run the generated API client, you need to make sure the generated source files are part of a project with the required dependencies. Your project must have a reference to the [bundle package](https://github.com/microsoft/kiota-typescript). For more information about kiota dependencies, refer to [the dependencies documentation](../dependencies.md). Run the following commands to get the required dependencies. ```bash -npm install @microsoft/kiota-abstractions +npm install @microsoft/kiota-bundle npm install @microsoft/kiota-authentication-azure -npm install @microsoft/kiota-http-fetchlibrary -npm install @microsoft/kiota-serialization-form -npm install @microsoft/kiota-serialization-json -npm install @microsoft/kiota-serialization-text -npm install @microsoft/kiota-serialization-multipart npm install @azure/identity ``` diff --git a/OpenAPI/kiota/using.md b/OpenAPI/kiota/using.md index 1a72671..9ed92fb 100644 --- a/OpenAPI/kiota/using.md +++ b/OpenAPI/kiota/using.md @@ -440,6 +440,8 @@ kiota info [(--openapi | -d) ] [--clear-cache | --cc] [(--version | -v) ] [(--search-key | -k) ] + [(--dependency-type | --dt) ] + [(--json)] ``` ### Example - global @@ -483,6 +485,21 @@ dotnet add package Microsoft.Kiota.Serialization.Text --version 1.1.0 dotnet add package Microsoft.Kiota.Serialization.Multipart --version 1.1.0 ``` +### Optional Parameters + +The info command accepts optional parameters commonly available on the other commands: + +- [--openapi](#--openapi--d) +- [--clear-cache](#--clear-cache---cc) +- [--log-level](#--log-level---ll) +- [--language](#--language--l) +- [--version](#--version--v) +- [--search-key](#--search-key--k) +- [--dependency-type](#--dependency-type---dt) +- [--json](#--json) + +### `--json` + Using the `--json` optional parameter renders the output in a machine parsable format: ```bash @@ -496,31 +513,43 @@ kiota info -l CSharp --json "dependencies": [ { "name": "Microsoft.Kiota.Abstractions", - "version": "1.6.1" + "version": "1.6.1", + "type": "abstractions" }, { "name": "Microsoft.Kiota.Http.HttpClientLibrary", - "version": "1.2.0" + "version": "1.2.0", + "type": "http" }, { "name": "Microsoft.Kiota.Serialization.Form", - "version": "1.1.0" + "version": "1.1.0", + "type": "serialization" }, { "name": "Microsoft.Kiota.Serialization.Json", - "version": "1.1.1" + "version": "1.1.1", + "type": "serialization" }, { "name": "Microsoft.Kiota.Authentication.Azure", - "version": "1.1.0" + "version": "1.1.0", + "type": "authentication" }, { "name": "Microsoft.Kiota.Serialization.Text", - "version": "1.1.0" + "version": "1.1.0", + "type": "serialization" }, { "name": "Microsoft.Kiota.Serialization.Multipart", - "version": "1.1.0" + "version": "1.1.0", + "type": "serialization" + }, + { + "name": "Microsoft.Kiota.Bundle", + "version": "1.1.0", + "type": "bundle" } ], "clientClassName": "", @@ -528,16 +557,31 @@ kiota info -l CSharp --json } ``` -### Optional Parameters +### `--dependency type (--dt)` -The info command accepts optional parameters commonly available on the other commands: +Since: 1.18.1 -- [--openapi](#--openapi--d) -- [--clear-cache](#--clear-cache---cc) -- [--log-level](#--log-level---ll) -- [--language](#--language--l) -- [--version](#--version--v) -- [--search-key](#--search-key--k) +The type of dependencies to display when used in combination with the language option. Does not impact the json output. Accepts multiple values. Default empty. + +```bash +kiota info --language CSharp --dependency-type authentication +``` + +Accepted values: + +| Value | Description | Requirement | +| ----- | ----------- | -------- | +| Abstractions | Define the core concepts of the language. | Build time | +| Additional | Required in addition to the abstractions or bundle. | Build time | +| Authentication | Implement authentication providers. | Optional | +| Bundle | Include abstractions, serialization and HTTP dependencies for simpler management. | | +| HTTP | Implement the request adapter with a specific HTTP client. | Runtime | +| Serialization | Implement serialization and deserialization for a given format. | Runtime | + +When no value is provided the info command will display: + +- All dependencies when no bundle is available. +- Bundle, authentication and additional dependencies when a bundle is available. ## Client update