Skip to content

Crustagen v1.0.0 🚀 (26.05.2023)

Choose a tag to compare

@stano45 stano45 released this 26 May 10:21
· 39 commits to main since this release
52d0d3a

What’s changed:

1. Command line interface (CLI) for the generator:

  • The -s argument is a path to the specification file
  • The -o argument is the output directory, where the generated project will be initialized
  • The -p argument is the project name, this will overwrite the project name from the spec
  • Default arguments (and spec) are provided, so that no arguments must be explicitly provided
  • The Clap library was utilized for the CLI

2. Parser for the AsyncAPI Specification, in either json or yaml format

  • The complete specification is parsed into an internal AsyncAPI struct representation
  • All schemas are parsed into a rust struct, along with Serde traits
  • Support for nested objects
  • Support for references (within the same spec file)

3. Generator for basic Pub/Sub functionality

  • main.rs template: A Tokio runtime which listens to NATS pub/sub messages, and executes a handler function, and a simple producer which currently just sends messages on a timer (for testing)
  • handler.rs template: async handler functions for each channel, and the parsed message structs (these will be moved to a separate file later)
  • A rust project is automatically created with cargo, and needed dependencies will be imported
  • The user only needs to execute cargo run in the generated directory