-
Notifications
You must be signed in to change notification settings - Fork 761
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(resolver): add tests for OpenAPI 3.1 useCircularStructures opt
Closes #2761
- Loading branch information
Showing
43 changed files
with
1,484 additions
and
60 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
189 changes: 134 additions & 55 deletions
189
src/helpers/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitor.js
Large diffs are not rendered by default.
Oops, something went wrong.
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
34 changes: 34 additions & 0 deletions
34
...-client/schema-object/__fixtures__/$anchor-external-circular-structures/dereferenced.json
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,34 @@ | ||
[ | ||
{ | ||
"openapi": "3.1.0", | ||
"components": { | ||
"schemas": { | ||
"User": { | ||
"type": "object", | ||
"properties": { | ||
"login": { | ||
"type": "string" | ||
}, | ||
"password": { | ||
"type": "string" | ||
}, | ||
"profile": { | ||
"$anchor": "user-profile", | ||
"properties": { | ||
"firstName": { | ||
"type": "string" | ||
}, | ||
"lastName": { | ||
"type": "string" | ||
}, | ||
"parent": { | ||
"$ref": "/home/smartbear/ex.json#user-profile" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
] |
18 changes: 18 additions & 0 deletions
18
...-1-swagger-client/schema-object/__fixtures__/$anchor-external-circular-structures/ex.json
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,18 @@ | ||
{ | ||
"$defs": { | ||
"UserProfile": { | ||
"$anchor": "user-profile", | ||
"properties": { | ||
"firstName": { | ||
"type": "string" | ||
}, | ||
"lastName": { | ||
"type": "string" | ||
}, | ||
"parent": { | ||
"$ref": "#user-profile" | ||
} | ||
} | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...-swagger-client/schema-object/__fixtures__/$anchor-external-circular-structures/root.json
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 @@ | ||
{ | ||
"openapi": "3.1.0", | ||
"components": { | ||
"schemas": { | ||
"User": { | ||
"type": "object", | ||
"properties": { | ||
"login": { | ||
"type": "string" | ||
}, | ||
"password": { | ||
"type": "string" | ||
}, | ||
"profile": { | ||
"$ref": "./ex.json#user-profile" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
...-client/schema-object/__fixtures__/$anchor-internal-circular-structures/dereferenced.json
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,48 @@ | ||
[ | ||
{ | ||
"openapi": "3.1.0", | ||
"components": { | ||
"schemas": { | ||
"User": { | ||
"type": "object", | ||
"properties": { | ||
"login": { | ||
"type": "string" | ||
}, | ||
"password": { | ||
"type": "string" | ||
}, | ||
"profile": { | ||
"$anchor": "user-profile", | ||
"properties": { | ||
"firstName": { | ||
"type": "string" | ||
}, | ||
"lastName": { | ||
"type": "string" | ||
}, | ||
"parent": { | ||
"$ref": "/home/smartbear/root.json#user-profile" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"UserProfile": { | ||
"$anchor": "user-profile", | ||
"properties": { | ||
"firstName": { | ||
"type": "string" | ||
}, | ||
"lastName": { | ||
"type": "string" | ||
}, | ||
"parent": { | ||
"$ref": "/home/smartbear/root.json#user-profile" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
] |
35 changes: 35 additions & 0 deletions
35
...-swagger-client/schema-object/__fixtures__/$anchor-internal-circular-structures/root.json
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,35 @@ | ||
{ | ||
"openapi": "3.1.0", | ||
"components": { | ||
"schemas": { | ||
"User": { | ||
"type": "object", | ||
"properties": { | ||
"login": { | ||
"type": "string" | ||
}, | ||
"password": { | ||
"type": "string" | ||
}, | ||
"profile": { | ||
"$ref": "#user-profile" | ||
} | ||
} | ||
}, | ||
"UserProfile": { | ||
"$anchor": "user-profile", | ||
"properties": { | ||
"firstName": { | ||
"type": "string" | ||
}, | ||
"lastName": { | ||
"type": "string" | ||
}, | ||
"parent": { | ||
"$ref": "#user-profile" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...er-client/schema-object/__fixtures__/$id-uri-direct-circular-structures/dereferenced.json
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,32 @@ | ||
[ | ||
{ | ||
"openapi": "3.1.0", | ||
"components": { | ||
"schemas": { | ||
"User": { | ||
"type": "object", | ||
"properties": { | ||
"login": { | ||
"type": "string" | ||
}, | ||
"password": { | ||
"type": "string" | ||
}, | ||
"profile": { | ||
"$id": "./nested/", | ||
"type": "object", | ||
"properties": { | ||
"avatar": { | ||
"type": "string" | ||
}, | ||
"user": { | ||
"$ref": "/home/smartbear/root.json#/components/schemas/User" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
] |
11 changes: 11 additions & 0 deletions
11
...agger-client/schema-object/__fixtures__/$id-uri-direct-circular-structures/nested/ex.json
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 @@ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"avatar": { | ||
"type": "string" | ||
}, | ||
"user": { | ||
"$ref": "../root.json#/components/schemas/User" | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...-1-swagger-client/schema-object/__fixtures__/$id-uri-direct-circular-structures/root.json
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,22 @@ | ||
{ | ||
"openapi": "3.1.0", | ||
"components": { | ||
"schemas": { | ||
"User": { | ||
"type": "object", | ||
"properties": { | ||
"login": { | ||
"type": "string" | ||
}, | ||
"password": { | ||
"type": "string" | ||
}, | ||
"profile": { | ||
"$id": "./nested/", | ||
"$ref": "./ex.json" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...client/schema-object/__fixtures__/$id-uri-enclosing-circular-structures/dereferenced.json
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,32 @@ | ||
[ | ||
{ | ||
"openapi": "3.1.0", | ||
"components": { | ||
"schemas": { | ||
"User": { | ||
"$id": "./nested/", | ||
"type": "object", | ||
"properties": { | ||
"login": { | ||
"type": "string" | ||
}, | ||
"password": { | ||
"type": "string" | ||
}, | ||
"profile": { | ||
"type": "object", | ||
"properties": { | ||
"avatar": { | ||
"type": "string" | ||
}, | ||
"user": { | ||
"$ref": "/home/smartbear/root.json#/components/schemas/User" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
] |
11 changes: 11 additions & 0 deletions
11
...er-client/schema-object/__fixtures__/$id-uri-enclosing-circular-structures/nested/ex.json
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 @@ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"avatar": { | ||
"type": "string" | ||
}, | ||
"user": { | ||
"$ref": "../root.json#/components/schemas/User" | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...swagger-client/schema-object/__fixtures__/$id-uri-enclosing-circular-structures/root.json
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,22 @@ | ||
{ | ||
"openapi": "3.1.0", | ||
"components": { | ||
"schemas": { | ||
"User": { | ||
"$id": "./nested/", | ||
"type": "object", | ||
"properties": { | ||
"login": { | ||
"type": "string" | ||
}, | ||
"password": { | ||
"type": "string" | ||
}, | ||
"profile": { | ||
"$ref": "./ex.json" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...-client/schema-object/__fixtures__/$id-uri-external-circular-structures/dereferenced.json
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,32 @@ | ||
[ | ||
{ | ||
"openapi": "3.1.0", | ||
"components": { | ||
"schemas": { | ||
"User": { | ||
"type": "object", | ||
"properties": { | ||
"login": { | ||
"type": "string" | ||
}, | ||
"password": { | ||
"type": "string" | ||
}, | ||
"profile": { | ||
"$id": "./nested/", | ||
"type": "object", | ||
"properties": { | ||
"avatar": { | ||
"type": "string" | ||
}, | ||
"user": { | ||
"$ref": "/home/smartbear/root.json#/components/schemas/User" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
] |
8 changes: 8 additions & 0 deletions
8
...ger-client/schema-object/__fixtures__/$id-uri-external-circular-structures/nested/ex.json
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 @@ | ||
{ | ||
"$defs": { | ||
"UserProfile": { | ||
"$id": "./nested/", | ||
"$ref": "./ex.json" | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...ent/schema-object/__fixtures__/$id-uri-external-circular-structures/nested/nested/ex.json
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 @@ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"avatar": { | ||
"type": "string" | ||
}, | ||
"user": { | ||
"$ref": "../../root.json#/components/schemas/User" | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...-swagger-client/schema-object/__fixtures__/$id-uri-external-circular-structures/root.json
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 @@ | ||
{ | ||
"openapi": "3.1.0", | ||
"components": { | ||
"schemas": { | ||
"User": { | ||
"type": "object", | ||
"properties": { | ||
"login": { | ||
"type": "string" | ||
}, | ||
"password": { | ||
"type": "string" | ||
}, | ||
"profile": { | ||
"$ref": "./nested/ex.json#/$defs/UserProfile" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.