Runtime data structures for AsyncAPI 3.0 specifications
This crate provides Rust types that represent AsyncAPI 3.0 specification objects. These types are used by the proc macros to generate specifications at compile time and can also be constructed manually.
Overview
The main types mirror the AsyncAPI 3.0 specification structure:
- [
AsyncApiSpec] - Root specification object - [
Info] - General API information - [
Server] - Server connection details - [
Channel] - Communication channels - [
Operation] - Send/receive operations - [
Message] - Message definitions - [
Schema] - JSON Schema definitions - [
Components] - Reusable components
Serialization
All types implement [serde::Serialize] and [serde::Deserialize] for JSON
serialization, following the AsyncAPI 3.0 specification's JSON Schema.
Example
use *;
use HashMap;
// Create a simple AsyncAPI specification
let spec = AsyncApiSpec ;
// Serialize to JSON
let json = to_string_pretty.unwrap;