https://github.com/asyncapi/converter-go
Convert AsyncAPI documents from older to newer versions with Golang
https://github.com/asyncapi/converter-go
asyncapi converter go golang hacktoberfest
Last synced: 4 months ago
JSON representation
Convert AsyncAPI documents from older to newer versions with Golang
- Host: GitHub
- URL: https://github.com/asyncapi/converter-go
- Owner: asyncapi
- License: apache-2.0
- Created: 2019-07-09T17:17:03.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-06-04T19:06:02.000Z (4 months ago)
- Last Synced: 2025-06-11T13:32:01.528Z (4 months ago)
- Topics: asyncapi, converter, go, golang, hacktoberfest
- Language: Go
- Homepage:
- Size: 232 KB
- Stars: 21
- Watchers: 6
- Forks: 10
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# AsyncAPI Converter
[](https://godoc.org/github.com/asyncapi/converter-go)  [](https://goreportcard.com/report/github.com/asyncapi/converter-go)
## Overview
The AsyncAPI Converter converts AsyncAPI documents from versions 1.0.0, 1.1.0 and 1.2.0 to version 2.0.0. It supports both `json` and `yaml` formats on input and output. By default, the AsyncAPI Converter converts a document into the `json` format.
## Prerequisites
- [Golang](https://golang.org/dl/) version 1.11+
## Installation
To install the AsyncAPI Converter package, run:
```bash
go get github.com/asyncapi/converter-go/...
```> **TIP:** You can also get binaries from the [latest GitHub release](https://github.com/asyncapi/converter-go/releases/latest).
## Usage
You can use the AsyncAPI Converter in the terminal or as a package.
### In CLI
Before you use the AsyncAPI Converter in the terminal, build the application. Run:
```bash
git clone https://github.com/asyncapi/converter-go.git
cd ./converter-go
go build -o=asyncapi-converter ./cmd/api-converter/main.go
```To convert a document use the following command:
```text
asyncapi-converter [--toYAML] [--id=]
```where:
- `document_path` is a mandatory argument that is either a URL or a file path to an AsyncAPI document
- `--toYAML` is an optional argument that allows producing results in the `yaml` format instead of `json`
- `--id` is an optional argument that allows specifying the application `id`**Examples**
See the following minimal examples of the AsyncAPI Converter usage in the terminal:
- `gitter-streaming` conversion from version 1.2.0 to 2.0.0 in the `json` format
```text
asyncapi-converter https://git.io/fjMPF
```- `gitter-streaming` conversion from version 1.2.0 to 2.0.0 in the `yaml` format
```bash
asyncapi-converter https://git.io/fjMPF --toYAML
```- `gitter-streaming` conversion from version 1.2.0 to 2.0.0 in the `json` format specifying the application `id`
```bash
asyncapi-converter https://git.io/fjMXl --id=urn:com.asynapi.streetlights
```### As a package
To see examples of how to use the AsyncAPI Converter as a package, go to the [README.md](./examples/README.md).
## Contribution
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`](https://github.com/asyncapi/.github/blob/master/CONTRIBUTING.md) document.## Credits