From 51064e8b6ddddd856a5a8cd2c621b7880b5871c3 Mon Sep 17 00:00:00 2001 From: utnim2 Date: Mon, 19 Aug 2024 03:25:30 +0530 Subject: [PATCH 1/2] add openapi conversion support --- docs/usage.md | 8 +- src/commands/convert.ts | 23 ++++-- src/core/flags/convert.flags.ts | 8 +- test/fixtures/openapi.yml | 137 +++++++++++++++++++++++++++++++ test/integration/convert.test.ts | 62 ++++++++++++++ 5 files changed, 227 insertions(+), 11 deletions(-) create mode 100644 test/fixtures/openapi.yml diff --git a/docs/usage.md b/docs/usage.md index ed4b97ff18e..34dd4adcf1d 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -308,11 +308,11 @@ _See code: [src/commands/config/versions.ts](https://github.com/asyncapi/cli/blo ## `asyncapi convert [SPEC-FILE]` -Convert asyncapi documents older to newer versions +Convert asyncapi documents older to newer versions or or OpenAPI documents to AsyncAPI ``` USAGE - $ asyncapi convert [SPEC-FILE] [-h] [-o ] [-t ] + $ asyncapi convert [SPEC-FILE] [-h] [-o ] [-t ] [-p ] ARGUMENTS SPEC-FILE spec path, url, or context-name @@ -320,10 +320,12 @@ ARGUMENTS FLAGS -h, --help Show CLI help. -o, --output= path to the file where the result is saved + -p, --perspective=