View all files | ||||
The AsyncAPI Parser validates AsyncAPI documents according to dedicated schemas. The supported schemas are:
Documents provided for the AsyncAPI Parser can be in the .yaml or .json formats. If a document is invalid, the parser provides a message listing all errors. If a document is valid, the parser provides dereferenced output. During the dereference process the AsyncAPI parser substitutes a reference with a full definition. The dereferenced output is always in the .json format.
⚠️ This package doesn't support AsyncAPI 1.x anymore. We recommend to upgrade to the latest AsyncAPI version using the AsyncAPI converter. If you need to convert documents on the fly, you may use the Node.js or Go converters.
To install the AsyncAPI Parser package, run:
TIP: You can also get binaries from the latest GitHub release.
You can use the AsyncAPI Parser in two ways:
Before you use the AsyncAPI Parser in the terminal, build the application. Run:
To use the AsyncAPI Parser run the following command:
where document_path is a mandatory argument that is either a URL or a file path to an AsyncAPI document.
You can also use the AsyncAPI Parser without building the application, using Golang. Run: bash go run ./cmd/api-parser/main.go <document_path> where document_path is a mandatory argument that is either a URL or a file path to an AsyncAPI document. Examples See the following examples of the AsyncAPI Parser usage in the terminal:
Validation of the gitter-streaming.yaml valid file:
Validation of the oneof.yml invalid file:
Output:
If you have a feature request, add it as an issue or propose changes in a pull request (PR). If you create a feature request, use the dedicated Feature request issue template. When you create a PR, follow the contributing rules described in the CONTRIBUTING.md document.