Microsoft.OpenApi.Kiota.Builder
1.22.0-preview.202412190001
Prefix Reserved
dotnet add package Microsoft.OpenApi.Kiota.Builder --version 1.22.0-preview.202412190001
NuGet\Install-Package Microsoft.OpenApi.Kiota.Builder -Version 1.22.0-preview.202412190001
<PackageReference Include="Microsoft.OpenApi.Kiota.Builder" Version="1.22.0-preview.202412190001" />
paket add Microsoft.OpenApi.Kiota.Builder --version 1.22.0-preview.202412190001
#r "nuget: Microsoft.OpenApi.Kiota.Builder, 1.22.0-preview.202412190001"
// Install Microsoft.OpenApi.Kiota.Builder as a Cake Addin #addin nuget:?package=Microsoft.OpenApi.Kiota.Builder&version=1.22.0-preview.202412190001&prerelease // Install Microsoft.OpenApi.Kiota.Builder as a Cake Tool #tool nuget:?package=Microsoft.OpenApi.Kiota.Builder&version=1.22.0-preview.202412190001&prerelease
Project
Kiota is a command line tool for generating an API client to call any OpenAPI described API you are interested in. The goal is to eliminate the need to take a dependency on a different API SDK for every API that you need to call. Kiota API clients provide a strongly typed experience with all the features you expect from a high quality API SDK, but without having to learn a new library for every HTTP API.
This library builds on top of the Microsoft.OpenAPI.NET library to ensure comprehensive support for APIs that use OpenAPI descriptions. One of the goals of the project is to provide the best code generator support possible for OpenAPI and JSON Schema features. The conceptual documentation describes how kiota works and the high level concepts, this readme documents how to get started with Kiota.
Getting started
Generating SDKs
- Install required tools and dependencies. (refer to the Supported Languages table under the Required tools & dependencies column)
- Get Kiota using one of the available options.
- Generate your API client, checkout the Parameters reference for the different options.
- Start calling your API using your fluent API Client.
Supported languages
The following table provides an overview of the languages supported by Kiota and the progress in the implementation of the different components.
Language | Generation | Abstractions | Serialization | Authentication | HTTP | Required tools & dependencies |
---|---|---|---|---|---|---|
CLI | 🛠️ | (see CSharp) + 🛠️ | (see CSharp) | (see CSharp) | (see CSharp) | link |
CSharp | ✔ | ✔ | FORM, JSON, MULTIPART, TEXT | Anonymous, API Key, Azure | ✔ | link |
Dart | ▶ | 🛠️ | 🛠️ FORM, ▶ JSON, ▶ MULTIPART, 🛠️ TEXT | 🛠️ Anonymous, 🛠️ API Key | 🛠️ | |
Go | ✔ | ✔ | FORM, JSON, MULTIPART, TEXT | Anonymous, API Key, Azure | ✔ | link |
Java | ✔ | ✔ | FORM, JSON, MULTIPART, TEXT | Anonymous, API Key, Azure | ✔ | link |
PHP | ✔ | ✔ | JSON, FORM, MULTIPART, TEXT | Anonymous, ✔️ PHP League | ✔ | link |
Python | ✔ | ✔ | FORM, JSON, MULTIPART, TEXT | Anonymous, Azure | ✔ | link |
Ruby | 🛠️ | 🛠️ | ❌ FORM, JSON, ❌ MULTIPART, ❌ TEXT | Anonymous, OAuth2 | 🛠️ | |
Swift | ❌ | 🛠️ | ❌ FORM, ❌ JSON, ❌ FORM, ❌ TEXT | Anonymous, ❌ Azure | ❌ | |
TypeScript/JavaScript | 🛠️ | 🛠️ | FORM, JSON, MULTIPART, TEXT | Anonymous, API Key, Azure, SPFx | 🛠️ | link |
Legend: ✔ → stable, 🛠️ → in preview, ❌ → not started, ▶ → in progress.
Parameters reference
Parameters are documented here.
Debugging
Make sure you install the pre-requisites first. If you are using Visual Studio Code as your IDE, the launch.json file already contains the configuration to run Kiota. By default this configuration will use the openApiDocs/v1.0/Mail.yml
under the PowerShell repository as the OpenAPI to generate an SDK for. By default this configuration will output the generated files in a graphdotnetv4|graphjavav4|graphtypescriptv4 folder located in the parent folder this repository is cloned in.
Selecting the language you want to generate an API client for in the Visual Studio Debug tab and hitting F5 will automatically build, start, and attach the debugging process to Kiota.
Samples
You can find samples of clients generated with Kiota in the Kiota samples repository.
An example of an application that is calling multiple API can be found in the KiotaApp repo
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.
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. For more information see the Code of Conduct FAQ or contact 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. 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.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- AsyncKeyedLock (>= 7.1.4)
- DotNet.Glob (>= 3.1.3)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.0)
- Microsoft.Kiota.Abstractions (>= 1.16.0)
- Microsoft.Kiota.Http.HttpClientLibrary (>= 1.16.0)
- Microsoft.Kiota.Serialization.Form (>= 1.16.0)
- Microsoft.Kiota.Serialization.Json (>= 1.16.0)
- Microsoft.kiota.Serialization.Multipart (>= 1.16.0)
- Microsoft.Kiota.Serialization.Text (>= 1.16.0)
- Microsoft.OpenApi (>= 1.6.22)
- Microsoft.OpenApi.ApiManifest (>= 0.5.5-preview)
- Microsoft.OpenApi.Readers (>= 1.6.22)
- Microsoft.Plugins.Manifest (>= 1.0.0-rc3)
- YamlDotNet (>= 16.2.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Microsoft.OpenApi.Kiota.Builder:
Package | Downloads |
---|---|
FastEndpoints.ClientGen.Kiota
API Client Generator for FastEndpoints using Kiota. |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Microsoft.OpenApi.Kiota.Builder:
Repository | Stars |
---|---|
FastEndpoints/FastEndpoints
A light-weight REST API development framework for ASP.NET 6 and newer.
|