Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Generate a rust client code by OpenAPI Generator

Generate a rust client code by OpenAPI Generator

Kentaro Matsumoto

August 16, 2024
Tweet

More Decks by Kentaro Matsumoto

Other Decks in Programming

Transcript

  1. 生成されたファイル群 generated-client ├── Cargo.toml ├── README.md ├── docs │ └──

    モデルに対応するドキュメント.md ├── git_push.sh └── src ├── apis │ ├── configuration.rs │ ├── default_api.rs │ └── mod.rs ├── lib.rs └── models ├── mod.rs └── モデルごとの.rs 3. OpenAPI Generator © 2024 estie, Inc. 12
  2. 生成されたコードの使い方 use chat::{apis, models}; #[tokio::main] async fn main() { let

    mut config = apis::configuration::Configuration::new(); let request = models::Chat::new(vec![ models::ChatRequestMessagesInner::ChatMessageParam(Box::new( "接続成功してくれ!!!!!!!".to_string(), )), ]); let result = apis::default_api::chat_api_post( &config, request, ).await; } 3. OpenAPI Generator © 2024 estie, Inc. 13