0.4.2 • Published 5 years ago

asyncapi-converter v0.4.2

Weekly downloads
81
License
Apache-2.0
Repository
-
Last release
5 years ago

AsyncAPI Converter

Convert AsyncAPI documents older to newer versions.

Installation

npm i -g asyncapi-converter

Usage

From CLI

Minimal example:

asyncapi-converter streetlights.yml

# Result:
asyncapi: '2.0.0'
channels:
...

Specify the application id:

asyncapi-converter --id=urn:com.asynapi.streetlights streetlights.yml

# Result:
asyncapi: '2.0.0'
id: 'urn:com.asynapi.streetlights'
...

Save the result in a file:

asyncapi-converter streetlights.yml > streetlights2.yml

As a package

const { convert } = require('asyncapi-converter')

try {
  const asyncapi = fs.readFileSync('streetlights.yml', 'utf-8')
  console.log(convert(asyncapi, '2.0.0', {
      id: 'urn:com.asyncapi.streetlights'
  }))
} catch (e) {
  console.error(e)
}

Known missing features

  • When converting from 1.x to 2.x, Streaming APIs (those using stream instead of topics or events) are converted correctly but information about framing type and delimiter is missing until a protocolInfo for that purpose is created.
0.4.2

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.1

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago