How to write spec files

The generator is mostly* compliant with the AsyncAPI specification

*Limitations

  • Only json payloads are currently supported for automatic deserialization
  • Only one server is currently supported and only nats protocol is supported
  • Generated microservice doesn't support authentication with NATS-broker out of the box
  • Only one message is currently supported per channel, payloads can be choosen freely including anyOf/oneOf/allOf
  • The generated rust types are required by default, if you want to use optional types, please modify the generated types after generation or use oneOf/anyOf/allOf to represent optional types
  • references in the specification are only suppported inside the same file, external references are not supported

Crustagen specific features

  • A channel supposed to be a stream can be declared in the specification file with the x-streamname field.
channels:
  {channel-name}:
    {channel-operation}:
      bindings:
        nats:
          x-streamname: testStream