From e204457a6996e469b8dc93199946c40790036250 Mon Sep 17 00:00:00 2001 From: Mintu Gogoi <127925465+Gmin2@users.noreply.github.com> Date: Mon, 23 Sep 2024 18:59:00 +0530 Subject: [PATCH] feat: added openapi conversion support (#1500) * add openapi conversion support * added the `format` flag --------- Co-authored-by: souvik Co-authored-by: asyncapi-bot --- docs/usage.md | 8 +- src/commands/convert.ts | 20 +++-- src/core/flags/convert.flags.ts | 15 +++- test/fixtures/openapi.yml | 137 +++++++++++++++++++++++++++++++ test/integration/convert.test.ts | 75 +++++++++++++++-- 5 files changed, 240 insertions(+), 15 deletions(-) create mode 100644 test/fixtures/openapi.yml diff --git a/docs/usage.md b/docs/usage.md index c1dedde1757..6046d453653 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=