APIPatterns / Moostodon

Moostodon, an example application for calling the Mastodon API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Moostodon

This repo contains a demonstration of using CADL to describe the Mastodon API and then using Kiota to generate API clients from the OpenAPI emitted from the CADL compiler.

Getting Started

Everything you need to get started designing APIs in CADL can be found in the CADL documentation. If you are looking to generate API clients from OpenAPI, you can find the documentation for Kiota here.

Running the demo

To regenerate the OpenAPI from the CADL you will need to have the CADL compiler installed. You can find instructions for installing the CADL compiler here.

From the spec directory, run the following command to generate the OpenAPI document:

cadl compile ./main.cadl

To generate the API clients, you will need to have Kiota installed. You can find instructions for installing Kiota here.

From the csharpMastodonConsole folder within the clients folder, run the following command to generate the API client:

kiota generate -l csharp  -o .\sdk -d ..\..\spec\cadl-output\openapi.json -c MastodonClient -n MastodonClientLib --co

Currently there is a minimal set of example calls in the program.cs file. You can run this using:

dotnet restore
dotnet build
dotnet run

[Moose with Canadian flag]

About

Moostodon, an example application for calling the Mastodon API

License:MIT License


Languages

Language:Python 26.0%Language:TypeScript 25.3%Language:C# 25.2%Language:JavaScript 22.4%Language:PowerShell 1.1%Language:Batchfile 0.1%