diff --git a/README.md b/README.md index 50d4b3e6..dadaecfd 100644 --- a/README.md +++ b/README.md @@ -204,11 +204,11 @@ To use this new conversion feature: ```js const fs = require('fs'); -const { convert } = require('@asyncapi/converter') +const { convertOpenAPI } = require('@asyncapi/converter') try { const openapi = fs.readFileSync('openapi.yml', 'utf-8') - const asyncapi = convert(openapi, '3.0.0', { from: 'openapi' }); + const asyncapi = convertOpenAPI(openapi, '3.0.0', { from: 'openapi' }); console.log(asyncapi); } catch (e) { console.error(e); @@ -218,11 +218,11 @@ try { When converting from OpenAPI to AsyncAPI you can now specify the perspective of the conversion using the `perspective` option. This allows you to choose whether the conversion should be from an application or client point of view ```js -const { convert } = require('@asyncapi/converter') +const { convertOpenAPI } = require('@asyncapi/converter') try { const asyncapi2 = fs.readFileSync('asyncapi2.yml', 'utf-8') - const asyncapi3 = convert(asyncapi2, '3.0.0', { openAPIToAsyncAPI: { perspective: 'client' } }); + const asyncapi3 = convertOpenAPI(asyncapi2, '3.0.0', { openAPIToAsyncAPI: { perspective: 'client' } }); console.log(asyncapi3); } catch (e) { console.error(e); diff --git a/src/index.ts b/src/index.ts index 808abac0..e63b8d26 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,3 @@ -export { convert } from './convert'; +export { convert, convertOpenAPI } from './convert'; export type { AsyncAPIDocument, AsyncAPIConvertVersion, OpenAPIConvertVersion, ConvertOptions } from './interfaces';