-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: resolve API alias paths correctly for config files located outsi…
…de the root folder
- Loading branch information
Showing
10 changed files
with
132 additions
and
45 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 | ||
--- | ||
|
||
Fixed an issue where an API alias's root path might be resolved incorrectly for configuration files located outside the root folder. |
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
8 changes: 8 additions & 0 deletions
8
__tests__/miscellaneous/apply-per-api-decorators/openapi.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,8 @@ | ||
openapi: 3.1.0 | ||
info: | ||
title: Test | ||
paths: {} | ||
components: | ||
schemas: | ||
Unused: | ||
type: string |
11 changes: 11 additions & 0 deletions
11
__tests__/miscellaneous/apply-per-api-decorators/plugins/decorators/version.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,11 @@ | ||
module.exports = sparkle; | ||
|
||
function sparkle() { | ||
return { | ||
Info: { | ||
leave(target) { | ||
target.version = '1.0.0'; | ||
}, | ||
}, | ||
}; | ||
} |
12 changes: 12 additions & 0 deletions
12
__tests__/miscellaneous/apply-per-api-decorators/plugins/test.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,12 @@ | ||
const version = require('./decorators/version.js'); | ||
|
||
module.exports = function testPlugin() { | ||
return { | ||
id: 'test', | ||
decorators: { | ||
oas3: { | ||
version, | ||
}, | ||
}, | ||
}; | ||
}; |
8 changes: 8 additions & 0 deletions
8
__tests__/miscellaneous/apply-per-api-decorators/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,8 @@ | ||
apis: | ||
test@v1: | ||
root: openapi.yaml | ||
decorators: | ||
test/version: on | ||
remove-unused-components: on | ||
plugins: | ||
- plugins/test.js |
33 changes: 33 additions & 0 deletions
33
__tests__/miscellaneous/apply-per-api-decorators/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 miscellaneous apply a decorator to a specific api (when the api is specified as an alias) 1`] = ` | ||
openapi: 3.1.0 | ||
info: | ||
title: Test | ||
version: 1.0.0 | ||
paths: {} | ||
components: | ||
schemas: | ||
Unused: | ||
type: string | ||
bundling ./__tests__/miscellaneous/apply-per-api-decorators/openapi.yaml... | ||
📦 Created a bundle for ./__tests__/miscellaneous/apply-per-api-decorators/openapi.yaml at stdout <test>ms. | ||
`; | ||
|
||
exports[`E2E miscellaneous apply a decorator to a specific api (without specifying the api) 1`] = ` | ||
openapi: 3.1.0 | ||
info: | ||
title: Test | ||
version: 1.0.0 | ||
paths: {} | ||
components: | ||
schemas: | ||
Unused: | ||
type: string | ||
bundling ./__tests__/miscellaneous/apply-per-api-decorators/openapi.yaml... | ||
📦 Created a bundle for ./__tests__/miscellaneous/apply-per-api-decorators/openapi.yaml at stdout <test>ms. | ||
`; |
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