-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: restrict bundling with --output but without inline apis (#1799)
* docs: update bundle description * Apply suggestions from code review * apply prettier * chore: restrict bundling with --output but without inline apis --------- Co-authored-by: Jacek Łękawa <164185257+JLekawa@users.noreply.github.com>
- Loading branch information
Showing
8 changed files
with
187 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@redocly/cli": patch | ||
--- | ||
|
||
Clarified usage of the `--output` option in the `bundle` command. |
7 changes: 7 additions & 0 deletions
7
__tests__/bundle/bundle-no-output-without-inline-apis/redocly.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apis: | ||
main: | ||
root: ./test.yaml | ||
rules: | ||
no-invalid-media-type-examples: | ||
severity: error | ||
allowAdditionalProperties: false |
33 changes: 33 additions & 0 deletions
33
__tests__/bundle/bundle-no-output-without-inline-apis/snapshot.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`E2E bundle bundle should NOT be invoked IF no positional apis provided AND --output specified 1`] = ` | ||
index.ts bundle [apis...] | ||
Bundle a multi-file API description to a single file. | ||
Positionals: | ||
apis [array] [default: []] | ||
Options: | ||
--version Show version number. [boolean] | ||
--help Show help. [boolean] | ||
-o, --output Output file or folder for inline APIs.[string] | ||
--ext Bundle file extension. | ||
[choices: "json", "yaml", "yml"] | ||
--skip-preprocessor Ignore certain preprocessors. [array] | ||
--skip-decorator Ignore certain decorators. [array] | ||
-d, --dereferenced Produce a fully dereferenced bundle. [boolean] | ||
-f, --force Produce bundle output even when errors occur. | ||
[boolean] | ||
--config Path to the config file. [string] | ||
--metafile Produce metadata about the bundle [string] | ||
--remove-unused-components Remove unused components. | ||
[boolean] [default: false] | ||
-k, --keep-url-references Keep absolute url references. [boolean] | ||
--lint-config Severity level for config file linting. | ||
[choices: "warn", "error", "off"] [default: "warn"] | ||
At least one inline API must be specified when using --output. | ||
`; |
25 changes: 25 additions & 0 deletions
25
__tests__/bundle/bundle-no-output-without-inline-apis/test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
openapi: 3.1.0 | ||
paths: | ||
/test-api: | ||
get: | ||
responses: | ||
'200': | ||
description: success | ||
content: | ||
application/json: | ||
schema: | ||
$defs: | ||
main_data: | ||
$anchor: main_data | ||
type: object | ||
properties: | ||
foo: | ||
type: string | ||
type: object | ||
oneOf: | ||
- properties: | ||
wrapper: | ||
$ref: '#main_data' | ||
- $ref: '#main_data' | ||
example: | ||
foo: TEST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e4e6782
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage report
Test suite run success
814 tests passing in 121 suites.
Report generated by 🧪jest coverage report action from e4e6782