Coder Social home page Coder Social logo

nikiforovall / kiota-getting-started Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 121 KB

Kiota + Aspire + .NET 8

Home Page: https://nikiforovall.github.io/dotnet/aspnetcore/2024/03/24/kiota-guide-deep-dive.html

Shell 0.92% C# 99.08%
aspire aspnet-core aspnetcore dotnet dotnet8 kiota

kiota-getting-started's Introduction

Kiota + Aspire .NET

This demo showcases the integration of Kiota, Aspire, and .NET 8! This project demonstrates how these technologies can work together seamlessly.

Overview

In this demo, we have an application (App.Client) that calls our application's API (App API). This application integrates with the Bing REST API. The unique aspect of this project is that every HTTP client is automatically generated based on OpenAPI and Kiota.

Technologies

Key Features

  • App.Client: This is our main application that interacts with the App API.
  • App: This is our application's API which serves as the bridge between App.Client and the Bing REST API.
  • Bing REST API Integration: Our application integrates with the Bing REST API to fetch data.
  • Automatic HTTP Client Generation: We leverage OpenAPI and Kiota to automate the generation of every HTTP client in our application.

Components

Component Description
App Integrates with Bing REST API
NewsSearch.Sdk Generated OpenAPI HTTP Client by Kiota. It's based on externally provided OpenAPI specification
App.Sdk Generated OpenAPI HTTP Client by Kiota
App.Client Invokes App via App.Sdk
App.Client.Sdk Generated OpenAPI HTTP Client by Kiota
App.Client.Cli Generated CLI Client by Kiota. Convention-based commands based on App.Client OpenAPI specification
App.AppHost Aspire Host
App.ServiceDefaults Reasonable service defaults provided in 'Aspire' paradigm.
graph LR
    App --> NewsSearchSdk["NewsSearch.Sdk"]
    App --> AppServiceDefaults["App.ServiceDefaults"]
    AppClient --> AppSdk["App.Sdk"]
    AppClient["App.Client"] --> AppServiceDefaults
    AppAppHost["App.AppHost"] --> App
    AppAppHost --> AppClient

Getting Started

Configure App and run Aspire AppHost.

dotnet user-secrets --project ./src/App set ApiKey "<key>"
dotnet run --project ./src/App.AppHost

See what App.Client.CLI can do.

$ dotnet run --project ./src/App.Client.Cli/ -- my trending get -h
# Description:

# Usage:
#   App.Client.Cli my trending get [options]

# Options:
#   --output <JSON|NONE|RAW_JSON|TABLE|TEXT>  [default: JSON]
#   --query <query>
#   -?, -h, --help                            Show help and usage information

Run:

$ dotnet run --project ./src/App.Client.Cli/ -- my trending get --output TABLE
# ┌───────────────────────────────────────────────────────────────────────────────────┐
# │ Value                                                                             │
# ├───────────────────────────────────────────────────────────────────────────────────┤
# │ US sues Apple                                                                     │
# │ Sabalenka on Koltsov's death                                                      │
# │ US submits UN draft resolution                                                    │
# │ Biden cancels $6 billion student debt                                             │
# │ Barron Trump's comment                                                            │
# │ Starbucks mugs recalled                                                           │
# │ Milwaukee election official convicted                                             │
# │ February home sales                                                               │
# │ Demi Moore shares tribute to Bruce Willis                                         │
# │ Congress unveils $1.2 trillion funding bill                                       │
# │ Bacteria found in colon cancer                                                    │
# │ Erv Woolsey dies                                                                  │
# │ Georgia executes man for 1993 murder                                              │
# │ Lukas Gage addresses rumors                                                       │
# │ UN resolution on AI                                                               │
# │ Dana Carvey apologizes to Sharon Stone                                            │
# │ `House of the Dragon' trailers                                                    │
# │ Summerfest 2024 lineup                                                            │
# │ Pig's kidney transplanted into a man                                              │
# │ Hayley Erbert, Derek Hough return                                                 │
# │ Airline CEOs seek meeting with Boeing directors                                   │
# │ Russia fires missiles at Kyiv                                                     │
# │ Airlines passengers' personal information review                                  │
# │ Micron stock jumps                                                                │
# │ Rocket Lab launches NRO spy satellites                                            │
# │ Idaho prisoner manhunt day 2                                                      │
# │ US weekly jobless claims                                                          │
# │ Hermès targeted in lawsuit                                                        │
# │ Powerball winning numbers                                                         │
# │ California voters pass Proposition 1                                              │
# │ Beyoncé to receive Innovator Award                                                │
# │ Maren Morris tour dates                                                           │
# │ Meta, Microsoft, X and Match join Epic Games                                      │
# │ Target doubling employee bonuses                                                  │
# │ Kevin Durant NBA career scoring list                                              │
# └───────────────────────────────────────────────────────────────────────────────────┘

See the trace:

trace-example

kiota-getting-started's People

Contributors

nikiforovall avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.