You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* chore: fix debug
* feat(openapi/reduce): ability to pass in opts
* test: fix test
* fix: fallback value when parsing through bad paths
* fix: another edge case
* docs: add language on this
* Update README.md
Co-authored-by: Jon Ursenbach <erunion@users.noreply.github.com>
* test: typo
Co-authored-by: Jon Ursenbach <erunion@users.noreply.github.com>
Copy file name to clipboardExpand all lines: README.md
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -246,7 +246,19 @@ We also offer a tool that allows you to reduce a large API definition down to a
246
246
rdme openapi:reduce [path-to-file.json]
247
247
```
248
248
249
-
The command will ask you a couple questions about how you wish to reduce the file and then do so. And as with the `openapi` command, you can also [omit the file path](#omitting-the-file-path).
249
+
The command will ask you a couple questions about how you wish to reduce the file and then do so. If you wish to automate this command, you can pass in CLI arguments to bypass the prompts. Here's an example use case:
250
+
251
+
- The input API definition is called `petstore.json`
252
+
- The file is reduced to only the `/pet/{id}` path and the `GET` and `PUT` methods
253
+
- The output file is called `petstore-reduced.json`
254
+
255
+
Here's what the resulting command looks like:
256
+
257
+
```
258
+
rdme openapi:reduce petstore.json --path /pet/{id} --method get --method put --out petstore-reduced.json
259
+
```
260
+
261
+
As with the `openapi` command, you can also [omit the file path](#omitting-the-file-path).
0 commit comments