Skip to content

Instantly share code, notes, and snippets.

@wk-j
Created August 1, 2023 09:08
Show Gist options
  • Save wk-j/0f9403f54aee7c5ff1e8e6db90d1c524 to your computer and use it in GitHub Desktop.
Save wk-j/0f9403f54aee7c5ff1e8e6db90d1c524 to your computer and use it in GitHub Desktop.
Kiota

Microsoft Kiota is a tool that generates API clients for HTTP REST APIs described by OpenAPI. It supports a wide range of languages and leverages the full capabilities of OpenAPI descriptions.

Here are some of its features:

  • Generate API clients for HTTP REST APIs described by OpenAPI.
  • Support for a wide range of languages.
  • Leverage the full capabilities of OpenAPI descriptions.
  • Generate only the source code necessary.
  • Minimize external dependencies.

If you're looking for a way to generate API clients for HTTP REST APIs described by OpenAPI, Microsoft Kiota is a great option. It's easy to use and supports a wide range of languages.

Example

The Kiota command line for .NET can be used to generate a .NET API client for the JSONPlaceholder REST API. The command is

kiota generate -l CSharp -c PostsClient -n KiotaPosts.Client -d ./posts-api.yml -o ./Client

The -l option specifies the language to generate the client for, in this case CSharp. The -c option specifies the name of the client class, in this case PostsClient. The -n option specifies the namespace of the client class, in this case KiotaPosts.Client. The -d option specifies the path to the OpenAPI description file, in this case ./posts-api.yml. The -o option specifies the output directory, in this case ./Client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment