# `mix async_api_spex.gen`
[🔗](https://github.com/jamescarr/ankusa/blob/async_api_spex-v0.2.0/packages/async_api_spex/lib/mix/tasks/async_api_spex.gen.ex#L1)

Writes an AsyncAPI 3.0 document to a file.

    mix async_api_spex.gen --spec MyApp.AsyncApi --output asyncapi.json

`--spec` is a module implementing `AsyncApiSpex.Spec`; `--output` defaults to
`asyncapi.json`. The document is validated first, and an invalid document
stops the task with the validation errors.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
