Git Product home page Git Product logo

converter-go's Introduction

AsyncAPI Converter

Go Doc Release Go Report Card

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

Installation

To install the AsyncAPI Converter package, run:

go get github.com/asyncapi/converter-go/...

TIP: You can also get binaries from the latest GitHub release.

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:

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:

asyncapi-converter <document_path> [--toYAML] [--id=<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

    asyncapi-converter https://git.io/fjMPF
    
  • gitter-streaming conversion from version 1.2.0 to 2.0.0 in the yaml format

    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

    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.

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 document.

Credits

converter-go's People

Contributors

asyncapi-bot avatar derberg avatar hutchhutchhutch avatar m00g3n avatar rafaelrubbioli avatar smoya avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.