From 4355f9ca9abe0ec16599f440fcc64507c813ada5 Mon Sep 17 00:00:00 2001 From: Oleh Shumov <“oleh@readme.io”> Date: Fri, 6 Dec 2024 19:34:15 +0100 Subject: [PATCH] chore: minor updates --- documentation/commands/openapi.md | 11 ++++++----- src/commands/openapi/refs.ts | 2 +- src/lib/prepareOas.ts | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/documentation/commands/openapi.md b/documentation/commands/openapi.md index e05bff469..e1e77161a 100644 --- a/documentation/commands/openapi.md +++ b/documentation/commands/openapi.md @@ -7,6 +7,7 @@ Manage your API definition (e.g., syncing, validation, analysis, conversion, etc * [`rdme openapi convert [SPEC]`](#rdme-openapi-convert-spec) * [`rdme openapi inspect [SPEC]`](#rdme-openapi-inspect-spec) * [`rdme openapi reduce [SPEC]`](#rdme-openapi-reduce-spec) +* [`rdme openapi refs [SPEC]`](#rdme-openapi-refs-spec) * [`rdme openapi validate [SPEC]`](#rdme-openapi-validate-spec) ## `rdme openapi [SPEC]` @@ -226,13 +227,13 @@ EXAMPLES $ rdme openapi reduce petstore.json --path /pet/{id} --method get --method put --out petstore.reduced.json ``` -## `rdme openapi:refs [SPEC]` +## `rdme openapi refs [SPEC]` Resolves circular and recursive references in OpenAPI by replacing them with object schemas. ``` USAGE - $ rdme openapi:refs [SPEC] [--out ] [--workingDirectory ] + $ rdme openapi refs [SPEC] [--out ] [--workingDirectory ] ARGUMENTS SPEC A file/URL to your API definition @@ -254,16 +255,16 @@ DESCRIPTION EXAMPLES This will resolve circular and recursive references in the OpenAPI definition at the given file or URL: - $ rdme openapi:refs [url-or-local-path-to-file] + $ rdme openapi refs [url-or-local-path-to-file] You can omit the file name and `rdme` will scan your working directory (and any subdirectories) for OpenAPI files. This approach will provide you with CLI prompts, so we do not recommend this technique in CI environments. - $ rdme openapi:refs + $ rdme openapi refs If you wish to automate this command, you can pass in CLI arguments to bypass the prompts: - $ rdme openapi:refs petstore.json --out petstore.openapi.json + $ rdme openapi refs petstore.json --out petstore.openapi.json ``` ## `rdme openapi validate [SPEC]` diff --git a/src/commands/openapi/refs.ts b/src/commands/openapi/refs.ts index c4d5411e1..a0cc0e873 100644 --- a/src/commands/openapi/refs.ts +++ b/src/commands/openapi/refs.ts @@ -312,7 +312,7 @@ export default class OpenAPIRefsCommand extends BaseCommand */ export default async function prepareOas( path: string | undefined, - command: 'openapi convert' | 'openapi inspect' | 'openapi reduce' | 'openapi validate' | 'openapi', + command: 'openapi convert' | 'openapi inspect' | 'openapi reduce' | 'openapi refs' |'openapi validate' | 'openapi', opts: { /** * Optionally convert the supplied or discovered API definition to the latest OpenAPI release.