Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add api:validate:local command and refactor shared functions #306

Merged
merged 5 commits into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 47 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ USAGE
* [`swaggerhub api:unpublish OWNER/API_NAME/VERSION`](#swaggerhub-apiunpublish)
* [`swaggerhub api:update OWNER/API_NAME/[VERSION]`](#swaggerhub-apiupdate)
* [`swaggerhub api:validate OWNER/API_NAME/[VERSION]`](#swaggerhub-apivalidate)
* [`swaggerhub api:validate:local`](#swaggerhub-apivalidatelocal)
* [`swaggerhub configure`](#swaggerhub-configure)
* [`swaggerhub domain:create OWNER/DOMAIN_NAME/[VERSION]`](#swaggerhub-domaincreate)
* [`swaggerhub domain:delete OWNER/DOMAIN_NAME/[VERSION]`](#swaggerhub-domaindelete)
Expand Down Expand Up @@ -362,21 +363,22 @@ _See code: [src/commands/api/update.js](https://github.com/SmartBear/swaggerhub-

## `swaggerhub api:validate`

get validation result for an API version
Get validation result for an API version

```
USAGE
$ swaggerhub api:validate OWNER/API_NAME/[VERSION] [-h] [-c]
$ swaggerhub api:validate OWNER/API_NAME/[VERSION] [-h] [-c] [-j]

ARGUMENTS
OWNER/API_NAME/[VERSION] API to fetch validation errors for from Swaggerhub

FLAGS
-c, --fail-on-critical Exit with error code 1 if there are critical standardization errors present
-h, --help Show CLI help.
-j, --json Print output in JSON instead of table format

DESCRIPTION
get validation result for an API version
Get validation result for an API version
When VERSION is not included in the argument, the default version will be validated.
An error will occur if the API version does not exist.
If the flag `-c` or `--failOnCritical` is used and there are standardization
Expand All @@ -391,7 +393,37 @@ EXAMPLES
$ swaggerhub api:validate --fail-on-critical organization/api
```

_See code: [src/commands/api/validate.js](https://github.com/SmartBear/swaggerhub-cli/blob/v0.7.2/src/commands/api/validate.js)_
_See code: [src/commands/api/validate/index.js](https://github.com/SmartBear/swaggerhub-cli/blob/v0.7.2/src/commands/api/validate/index.js)_

## `swaggerhub api:validate:local`

Runs a scan against a local API definition using the organization's standardization configuration on SwaggerHub.

```
USAGE
$ swaggerhub api:validate:local -f <value> -o <value> [-h] [-c] [-j]

FLAGS
-c, --fail-on-critical Exit with error code 1 if there are critical standardization errors present
-f, --file=<value> (required) Path of API definition file to run scan against
-h, --help Show CLI help.
-j, --json Print output in JSON instead of table format
-o, --organization=<value> (required) Which organization's standardization settings to use for linting the target
definition

DESCRIPTION
Runs a scan against a local API definition using the organization's standardization configuration on SwaggerHub.
If the flag `-c` or `--failOnCritical` is used and there are standardization
errors with `Critical` severity present, the command will exit with error code `1`.


EXAMPLES
$ swaggerhub api:validate-local -c -j -o myOrg -f ./my-api.yaml

$ swaggerhub api:validate-local --fail-on-critical --json --organization myOrg --file ./my-api/json
CalemRoelofsSB marked this conversation as resolved.
Show resolved Hide resolved
```

_See code: [src/commands/api/validate/local.js](https://github.com/SmartBear/swaggerhub-cli/blob/v0.7.2/src/commands/api/validate/local.js)_

## `swaggerhub configure`

Expand Down Expand Up @@ -646,7 +678,7 @@ DESCRIPTION
Display help for swaggerhub.
```

_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.8/src/commands/help.ts)_
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.10/src/commands/help.ts)_

## `swaggerhub integration:create`

Expand Down Expand Up @@ -798,19 +830,22 @@ List installed plugins.

```
USAGE
$ swaggerhub plugins [--core]
$ swaggerhub plugins [--json] [--core]

FLAGS
--core Show core plugins.

GLOBAL FLAGS
--json Format output as json.

DESCRIPTION
List installed plugins.

EXAMPLES
$ swaggerhub plugins
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.4.3/src/commands/plugins/index.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.1.5/src/commands/plugins/index.ts)_

## `swaggerhub plugins:install`

Expand Down Expand Up @@ -875,7 +910,7 @@ EXAMPLES
$ swaggerhub plugins:inspect myplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.4.3/src/commands/plugins/inspect.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.1.5/src/commands/plugins/inspect.ts)_

## `swaggerhub plugins:install`

Expand Down Expand Up @@ -915,7 +950,7 @@ EXAMPLES
$ swaggerhub plugins:install someuser/someplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.4.3/src/commands/plugins/install.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.1.5/src/commands/plugins/install.ts)_

## `swaggerhub plugins:link`

Expand Down Expand Up @@ -944,7 +979,7 @@ EXAMPLES
$ swaggerhub plugins:link myplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.4.3/src/commands/plugins/link.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.1.5/src/commands/plugins/link.ts)_

## `swaggerhub plugins:uninstall`

Expand Down Expand Up @@ -992,7 +1027,7 @@ ALIASES
$ swaggerhub plugins:remove
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.4.3/src/commands/plugins/uninstall.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.1.5/src/commands/plugins/uninstall.ts)_

## `swaggerhub plugins:uninstall`

Expand Down Expand Up @@ -1033,7 +1068,7 @@ DESCRIPTION
Update installed plugins.
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.4.3/src/commands/plugins/update.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.1.5/src/commands/plugins/update.ts)_

## `swaggerhub project:api:add`

Expand Down
Loading