Skip to content

Commit

Permalink
Support security opts in openapi test
Browse files Browse the repository at this point in the history
  • Loading branch information
anttiviljami committed Oct 14, 2023
1 parent 5e28e07 commit 09a59bc
Show file tree
Hide file tree
Showing 6 changed files with 20,319 additions and 45 deletions.
56 changes: 27 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ openapi help
* [`openapi swagger-editor [DEFINITION]`](#openapi-swagger-editor-definition)
* [`openapi swagger-ui [DEFINITION]`](#openapi-swagger-ui-definition)
* [`openapi swagger2openapi [DEFINITION]`](#openapi-swagger2openapi-definition)
* [`openapi test [DEFINITION]`](#openapi-test-definition)
* [`openapi test`](#openapi-test)
* [`openapi test add [DEFINITION]`](#openapi-test-add-definition)
* [`openapi typegen [DEFINITION]`](#openapi-typegen-definition)
* [`openapi unload`](#openapi-unload)
Expand Down Expand Up @@ -84,7 +84,7 @@ EXAMPLES
$ openapi auth --security BasicAuth --username admin --password password
```

_See code: [src/commands/auth.ts](https://github.com/openapistack/openapicmd/blob/v1.17.2/src/commands/auth.ts)_
_See code: [src/commands/auth.ts](https://github.com/openapistack/openapicmd/blob/v2.0.0-rc1/src/commands/auth.ts)_

## `openapi call [DEFINITION]`

Expand Down Expand Up @@ -132,7 +132,7 @@ EXAMPLES
$ openapi call -o createPet -d '{ "name": "Garfield" }'
```

_See code: [src/commands/call.ts](https://github.com/openapistack/openapicmd/blob/v1.17.2/src/commands/call.ts)_
_See code: [src/commands/call.ts](https://github.com/openapistack/openapicmd/blob/v2.0.0-rc1/src/commands/call.ts)_

## `openapi help [COMMANDS]`

Expand Down Expand Up @@ -190,7 +190,7 @@ EXAMPLES
$ openapi info ./openapi.yml
```

_See code: [src/commands/info.ts](https://github.com/openapistack/openapicmd/blob/v1.17.2/src/commands/info.ts)_
_See code: [src/commands/info.ts](https://github.com/openapistack/openapicmd/blob/v2.0.0-rc1/src/commands/info.ts)_

## `openapi init`

Expand Down Expand Up @@ -223,7 +223,7 @@ EXAMPLES
$ openapi init --title 'My API' > openapi.yml
```

_See code: [src/commands/init.ts](https://github.com/openapistack/openapicmd/blob/v1.17.2/src/commands/init.ts)_
_See code: [src/commands/init.ts](https://github.com/openapistack/openapicmd/blob/v2.0.0-rc1/src/commands/init.ts)_

## `openapi load DEFINITION`

Expand All @@ -249,7 +249,7 @@ EXAMPLES
$ openapi load https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml
```

_See code: [src/commands/load.ts](https://github.com/openapistack/openapicmd/blob/v1.17.2/src/commands/load.ts)_
_See code: [src/commands/load.ts](https://github.com/openapistack/openapicmd/blob/v2.0.0-rc1/src/commands/load.ts)_

## `openapi mock [DEFINITION]`

Expand Down Expand Up @@ -285,7 +285,7 @@ EXAMPLES
$ openapi mock https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml
```

_See code: [src/commands/mock.ts](https://github.com/openapistack/openapicmd/blob/v1.17.2/src/commands/mock.ts)_
_See code: [src/commands/mock.ts](https://github.com/openapistack/openapicmd/blob/v2.0.0-rc1/src/commands/mock.ts)_

## `openapi read [DEFINITION]`

Expand Down Expand Up @@ -324,7 +324,7 @@ EXAMPLES
$ openapi read ./openapi.yml -f json > openapi.json
```

_See code: [src/commands/read.ts](https://github.com/openapistack/openapicmd/blob/v1.17.2/src/commands/read.ts)_
_See code: [src/commands/read.ts](https://github.com/openapistack/openapicmd/blob/v2.0.0-rc1/src/commands/read.ts)_

## `openapi swagger-editor [DEFINITION]`

Expand Down Expand Up @@ -352,7 +352,7 @@ EXAMPLES
$ openapi swagger-editor ./openapi.yml
```

_See code: [src/commands/swagger-editor.ts](https://github.com/openapistack/openapicmd/blob/v1.17.2/src/commands/swagger-editor.ts)_
_See code: [src/commands/swagger-editor.ts](https://github.com/openapistack/openapicmd/blob/v2.0.0-rc1/src/commands/swagger-editor.ts)_

## `openapi swagger-ui [DEFINITION]`

Expand Down Expand Up @@ -400,7 +400,7 @@ EXAMPLES
$ openapi swagger-ui ./openapi.yml --bundle outDir
```

_See code: [src/commands/swagger-ui.ts](https://github.com/openapistack/openapicmd/blob/v1.17.2/src/commands/swagger-ui.ts)_
_See code: [src/commands/swagger-ui.ts](https://github.com/openapistack/openapicmd/blob/v2.0.0-rc1/src/commands/swagger-ui.ts)_

## `openapi swagger2openapi [DEFINITION]`

Expand Down Expand Up @@ -437,19 +437,16 @@ EXAMPLES
$ openapi swagger2openapi --yaml ./swagger.json > openapi.yml
```

_See code: [src/commands/swagger2openapi.ts](https://github.com/openapistack/openapicmd/blob/v1.17.2/src/commands/swagger2openapi.ts)_
_See code: [src/commands/swagger2openapi.ts](https://github.com/openapistack/openapicmd/blob/v2.0.0-rc1/src/commands/swagger2openapi.ts)_

## `openapi test [DEFINITION]`
## `openapi test`

Run automated tests against APIs

```
USAGE
$ openapi test [DEFINITION] [-h] [-D] [-B] [-R <value>] [-H <value>] [-V] [-S <value>] [-I <value>] [-C
<value>] [-o <value>] [-v] [-s <value>] [-k <value>] [-t <value>] [-u <value>] [-p <value>]
ARGUMENTS
DEFINITION input definition file
$ openapi test [-h] [-D] [-B] [-R <value>] [-H <value>] [-V] [-S <value>] [-I <value>] [-C <value>] [-o
<value>] [-v]
FLAGS
-B, --bundle resolve remote $ref pointers
Expand All @@ -462,12 +459,7 @@ FLAGS
-S, --server=http://localhost:9000... override servers definition
-V, --validate validate against openapi schema
-h, --help Show CLI help.
-k, --apikey=<value> set api key
-o, --operation=operationId filter by operationId
-p, --password=<value> set basic auth password
-s, --security=<value>... use security scheme
-t, --token=<value> set bearer token
-u, --username=<value> set basic auth username
-v, --verbose verbose mode
DESCRIPTION
Expand All @@ -479,7 +471,7 @@ EXAMPLES
$ openapi test -o getPets
```

_See code: [src/commands/test/index.ts](https://github.com/openapistack/openapicmd/blob/v1.17.2/src/commands/test/index.ts)_
_See code: [src/commands/test/index.ts](https://github.com/openapistack/openapicmd/blob/v2.0.0-rc1/src/commands/test/index.ts)_

## `openapi test add [DEFINITION]`

Expand All @@ -488,8 +480,8 @@ Add automated tests for API operations
```
USAGE
$ openapi test add [DEFINITION] [-h] [-D] [-B] [-R <value>] [-H <value>] [-V] [-S <value>] [-I <value>] [-C
<value>] [-o <value>] [-p <value>] [-d <value>] [-v] [-s <value>] [-k <value>] [-t <value>] [-u <value>] [-p
<value>]
<value>] [-o <value>] [-n <value>] [-c Success2XX] [-p <value>] [-d <value>] [-v] [-s <value>] [-k <value>] [-t
<value>] [-u <value>] [-p <value>]
ARGUMENTS
DEFINITION input definition file
Expand All @@ -504,9 +496,11 @@ FLAGS
-R, --root=/ override API root path
-S, --server=http://localhost:9000... override servers definition
-V, --validate validate against openapi schema
-c, --checks=2XXStatus... checks to include in test
-d, --data=<value> request body
-h, --help Show CLI help.
-k, --apikey=<value> set api key
-n, --name=my test test name
-o, --operation=operationId operationId
-p, --param=key=value... parameter
-p, --password=<value> set basic auth password
Expand All @@ -519,10 +513,14 @@ DESCRIPTION
Add automated tests for API operations
EXAMPLES
$ openapi test add -o getPets
$ openapi test add
$ openapi test add -o getPet
$ openapi test add -o getPet --name "with id=1"
```

_See code: [src/commands/test/add.ts](https://github.com/openapistack/openapicmd/blob/v1.17.2/src/commands/test/add.ts)_
_See code: [src/commands/test/add.ts](https://github.com/openapistack/openapicmd/blob/v2.0.0-rc1/src/commands/test/add.ts)_

## `openapi typegen [DEFINITION]`

Expand Down Expand Up @@ -555,7 +553,7 @@ EXAMPLES
$ openapi typegen ./openapi.yml > openapi.d.ts
```

_See code: [src/commands/typegen.ts](https://github.com/openapistack/openapicmd/blob/v1.17.2/src/commands/typegen.ts)_
_See code: [src/commands/typegen.ts](https://github.com/openapistack/openapicmd/blob/v2.0.0-rc1/src/commands/typegen.ts)_

## `openapi unload`

Expand All @@ -575,7 +573,7 @@ EXAMPLES
$ openapi unload
```

_See code: [src/commands/unload.ts](https://github.com/openapistack/openapicmd/blob/v1.17.2/src/commands/unload.ts)_
_See code: [src/commands/unload.ts](https://github.com/openapistack/openapicmd/blob/v2.0.0-rc1/src/commands/unload.ts)_
<!-- commandsstop -->

## Contributing
Expand Down
Loading

0 comments on commit 09a59bc

Please sign in to comment.