-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: duplicated components created when referencing from components (#…
- Loading branch information
1 parent
5e7d408
commit c02649d
Showing
19 changed files
with
127 additions
and
2 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,3 @@ | ||
apis: | ||
main: | ||
root: ./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 @@ | ||
type: object |
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 | ||
paths: | ||
/path: | ||
$ref: './paths/path.yaml' | ||
components: | ||
schemas: | ||
Test: | ||
$ref: './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,6 @@ | ||
get: | ||
requestBody: | ||
content: | ||
'application/json': | ||
schema: | ||
$ref: ../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,21 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`E2E bundle no-duplicated-components 1`] = ` | ||
openapi: 3.1.0 | ||
paths: | ||
/path: | ||
get: | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/Test' | ||
components: | ||
schemas: | ||
Test: | ||
type: object | ||
bundling ./openapi.yaml... | ||
📦 Created a bundle for ./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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
apis: | ||
main: | ||
root: ./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,9 @@ | ||
openapi: 3.0.3 | ||
paths: | ||
/pets/{petId}: | ||
$ref: './paths/Pet.yaml' | ||
components: | ||
schemas: | ||
$ref: './schemas/_index.yaml' | ||
parameters: | ||
$ref: './parameters/_index.yaml' |
4 changes: 4 additions & 0 deletions
4
__tests__/bundle/no-self-referenced-components/parameters/PetId.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,4 @@ | ||
name: petId | ||
in: path | ||
schema: | ||
type: string |
2 changes: 2 additions & 0 deletions
2
__tests__/bundle/no-self-referenced-components/parameters/_index.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,2 @@ | ||
PetId: | ||
$ref: './PetId.yaml' |
9 changes: 9 additions & 0 deletions
9
__tests__/bundle/no-self-referenced-components/paths/Pet.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,9 @@ | ||
get: | ||
parameters: | ||
- $ref: '../parameters/PetId.yaml' | ||
responses: | ||
'200': | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../schemas/Pet.yaml' |
1 change: 1 addition & 0 deletions
1
__tests__/bundle/no-self-referenced-components/schemas/Pet.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 @@ | ||
type: object |
2 changes: 2 additions & 0 deletions
2
__tests__/bundle/no-self-referenced-components/schemas/_index.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,2 @@ | ||
Pet: | ||
$ref: './Pet.yaml' |
30 changes: 30 additions & 0 deletions
30
__tests__/bundle/no-self-referenced-components/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,30 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`E2E bundle no-self-referenced-components 1`] = ` | ||
openapi: 3.0.3 | ||
paths: | ||
/pets/{petId}: | ||
get: | ||
parameters: | ||
- $ref: '#/components/parameters/PetId' | ||
responses: | ||
'200': | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/Pet' | ||
components: | ||
schemas: | ||
Pet: | ||
type: object | ||
parameters: | ||
PetId: | ||
name: petId | ||
in: path | ||
schema: | ||
type: string | ||
bundling ./openapi.yaml... | ||
📦 Created a bundle for ./openapi.yaml at stdout <test>ms. | ||
`; |
3 changes: 3 additions & 0 deletions
3
__tests__/bundle/no-self-referenced-or-duplicated-components/.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,3 @@ | ||
apis: | ||
main: | ||
root: ./openapi.yaml |
3 changes: 3 additions & 0 deletions
3
__tests__/bundle/no-self-referenced-or-duplicated-components/components/schemas.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,3 @@ | ||
schemas: | ||
myObject: | ||
$ref: ../folder/myObject.v2.schema.yaml |
1 change: 1 addition & 0 deletions
1
__tests__/bundle/no-self-referenced-or-duplicated-components/folder/myObject.v2.schema.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 @@ | ||
type: object |
3 changes: 3 additions & 0 deletions
3
__tests__/bundle/no-self-referenced-or-duplicated-components/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,3 @@ | ||
openapi: 3.0.3 | ||
components: | ||
$ref: ./components/schemas.yaml |
13 changes: 13 additions & 0 deletions
13
__tests__/bundle/no-self-referenced-or-duplicated-components/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,13 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`E2E bundle no-self-referenced-or-duplicated-components 1`] = ` | ||
openapi: 3.0.3 | ||
components: | ||
schemas: | ||
myObject.v2.schema: | ||
type: object | ||
bundling ./openapi.yaml... | ||
📦 Created a bundle for ./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
c02649d
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
585 tests passing in 85 suites.
Report generated by 🧪jest coverage report action from c02649d