Skip to content

v0.1.0 - Initial MVP Release

Choose a tag to compare

@mlilback mlilback released this 06 Nov 17:19
· 37 commits to main since this release

AsyncAPI 3.0 Specification Generation for Rust

Generate AsyncAPI documentation directly from your Rust code using procedural macros.

✨ Features

  • #[derive(ToAsyncApiMessage)] - Generate message metadata and JSON schemas from Rust types
  • #[derive(AsyncApi)] - Generate complete AsyncAPI specifications
  • #[asyncapi_messages(...)] - Automatically integrate message types into specs
  • Full schemars integration - JSON Schema generation from Rust types
  • Server, channel, and operation definitions - Complete AsyncAPI 3.0 support
  • Binary protocol support - triggers_binary attribute for binary messages
  • Framework integration - Examples for actix-ws, axum, and tungstenite
  • 9 comprehensive examples - From simple to real-world usage
  • Complete documentation - Full rustdoc on docs.rs

🚀 Getting Started

Add to your `Cargo.toml`:

```toml
[dependencies]
asyncapi-rust = "0.1"
serde = { version = "1.0", features = ["derive"] }
schemars = { version = "0.8", features = ["derive"] }
```

Quick example:

```rust
use asyncapi_rust::{AsyncApi, ToAsyncApiMessage, schemars::JsonSchema};
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, JsonSchema, ToAsyncApiMessage)]
#[serde(tag = "type")]
pub enum ChatMessage {
#[serde(rename = "user.join")]
UserJoin { username: String, room: String },
}

#[derive(AsyncApi)]
#[asyncapi(title = "Chat API", version = "1.0.0")]
#[asyncapi_messages(ChatMessage)]
struct ChatApi;
```

📦 Published Crates

📖 Documentation

🎯 What's Included

Core Functionality

  • Message metadata generation from Rust types
  • JSON Schema generation via schemars
  • Complete AsyncAPI 3.0 spec generation
  • Automatic message integration into specs
  • serde attribute support (rename, tag, etc.)

Advanced Features

  • Binary protocol support
  • Server definitions
  • Channel definitions
  • Operation definitions (send/receive)
  • Helper attributes for documentation

Examples

  1. simple.rs - Basic message types
  2. chat_api.rs - Complete spec
  3. asyncapi_derive.rs - AsyncApi derive usage
  4. generate_spec_file.rs - File generation
  5. full_asyncapi_derive.rs - All features
  6. message_integration.rs - Message integration
  7. actix_websocket.rs - actix-web integration
  8. axum_websocket.rs - axum integration
  9. framework_integration_guide.rs - Framework guide

🧪 Testing

  • 20 unit tests
  • 11 integration tests
  • 10 documentation tests
  • Clippy clean
  • MSRV: Rust 1.85

📝 Release Notes

This is the initial MVP release with complete functionality for generating AsyncAPI 3.0 specifications from Rust code. The API is not yet stable and may change in future releases.

Key Additions in This Release

  • Complete AsyncAPI 3.0 models
  • ToAsyncApiMessage derive macro
  • AsyncApi derive macro
  • Message integration with #[asyncapi_messages(...)]
  • Full schemars integration
  • Comprehensive documentation
  • Real-world framework examples

🙏 Acknowledgments

Inspired by utoipa for OpenAPI generation and the AsyncAPI Initiative.


License: MIT OR Apache-2.0
Author: Mark Lilback