-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Oleh Shumov
committed
Dec 9, 2024
1 parent
e790dec
commit ae39d1e
Showing
3 changed files
with
364 additions
and
0 deletions.
There are no files selected for viewing
202 changes: 202 additions & 0 deletions
202
__tests__/__fixtures__/circular-references-oas/combined-cases-resolved.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,202 @@ | ||
{ | ||
"openapi": "3.0.3", | ||
"info": { | ||
"title": "API with Cyclic References", | ||
"version": "1.0.0" | ||
}, | ||
"paths": { | ||
"/example": { | ||
"get": { | ||
"summary": "Retrieve data with cyclic references", | ||
"responses": { | ||
"200": { | ||
"description": "Successful response", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"nodeA": { | ||
"$ref": "#/components/schemas/NodeA" | ||
}, | ||
"nodeC": { | ||
"$ref": "#/components/schemas/NodeC" | ||
}, | ||
"nodeD": { | ||
"$ref": "#/components/schemas/NodeD" | ||
}, | ||
"complexNode": { | ||
"$ref": "#/components/schemas/ComplexNode" | ||
}, | ||
"selfReferencingNode": { | ||
"$ref": "#/components/schemas/SelfReferencingNode" | ||
}, | ||
"deepRecursiveNode": { | ||
"$ref": "#/components/schemas/DeepRecursiveNode" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"NodeA": { | ||
"type": "object", | ||
"properties": { | ||
"nodeB": { | ||
"$ref": "#/components/schemas/NodeB" | ||
} | ||
} | ||
}, | ||
"NodeB": { | ||
"type": "object", | ||
"properties": { | ||
"nodeA": { | ||
"$ref": "#/components/schemas/NodeARef" | ||
} | ||
} | ||
}, | ||
"NodeC": { | ||
"type": "object", | ||
"properties": { | ||
"self": { | ||
"$ref": "#/components/schemas/NodeCRef" | ||
} | ||
} | ||
}, | ||
"NodeD": { | ||
"type": "object", | ||
"properties": { | ||
"nodeE": { | ||
"$ref": "#/components/schemas/NodeE" | ||
} | ||
} | ||
}, | ||
"NodeE": { | ||
"type": "object", | ||
"properties": { | ||
"nodeD": { | ||
"$ref": "#/components/schemas/NodeDRef" | ||
} | ||
} | ||
}, | ||
"ComplexNode": { | ||
"type": "object", | ||
"properties": { | ||
"nodeF": { | ||
"$ref": "#/components/schemas/NodeF" | ||
} | ||
} | ||
}, | ||
"NodeF": { | ||
"type": "object", | ||
"properties": { | ||
"nodeG": { | ||
"$ref": "#/components/schemas/NodeG" | ||
} | ||
} | ||
}, | ||
"NodeG": { | ||
"type": "object", | ||
"properties": { | ||
"nodeH": { | ||
"$ref": "#/components/schemas/NodeH" | ||
} | ||
} | ||
}, | ||
"NodeH": { | ||
"type": "object", | ||
"properties": { | ||
"complexNode": { | ||
"$ref": "#/components/schemas/ComplexNodeRef" | ||
} | ||
} | ||
}, | ||
"SelfReferencingNode": { | ||
"type": "object", | ||
"properties": { | ||
"node": { | ||
"type": "object" | ||
} | ||
} | ||
}, | ||
"DeepRecursiveNode": { | ||
"type": "object", | ||
"properties": { | ||
"child": { | ||
"$ref": "#/components/schemas/DeepRecursiveNodeRef" | ||
} | ||
} | ||
}, | ||
"DeepRecursiveNodeRef": { | ||
"type": "object", | ||
"properties": { | ||
"child": { | ||
"type": "object" | ||
} | ||
} | ||
}, | ||
"NodeARef": { | ||
"type": "object", | ||
"properties": { | ||
"nodeB": { | ||
"type": "object" | ||
} | ||
} | ||
}, | ||
"NodeCRef": { | ||
"type": "object", | ||
"properties": { | ||
"self": { | ||
"type": "object" | ||
} | ||
} | ||
}, | ||
"NodeDRef": { | ||
"type": "object", | ||
"properties": { | ||
"nodeE": { | ||
"type": "object" | ||
} | ||
} | ||
}, | ||
"ComplexNodeRef": { | ||
"type": "object", | ||
"properties": { | ||
"nodeF": { | ||
"$ref": "#/components/schemas/NodeFRef" | ||
} | ||
} | ||
}, | ||
"NodeFRef": { | ||
"type": "object", | ||
"properties": { | ||
"nodeG": { | ||
"$ref": "#/components/schemas/NodeGRef" | ||
} | ||
} | ||
}, | ||
"NodeGRef": { | ||
"type": "object", | ||
"properties": { | ||
"nodeH": { | ||
"$ref": "#/components/schemas/NodeHRef" | ||
} | ||
} | ||
}, | ||
"NodeHRef": { | ||
"type": "object", | ||
"properties": { | ||
"complexNode": { | ||
"type": "object" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
138 changes: 138 additions & 0 deletions
138
__tests__/__fixtures__/circular-references-oas/combined-cases.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,138 @@ | ||
{ | ||
"openapi": "3.0.3", | ||
"info": { | ||
"title": "API with Cyclic References", | ||
"version": "1.0.0" | ||
}, | ||
"paths": { | ||
"/example": { | ||
"get": { | ||
"summary": "Retrieve data with cyclic references", | ||
"responses": { | ||
"200": { | ||
"description": "Successful response", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"nodeA": { | ||
"$ref": "#/components/schemas/NodeA" | ||
}, | ||
"nodeC": { | ||
"$ref": "#/components/schemas/NodeC" | ||
}, | ||
"nodeD": { | ||
"$ref": "#/components/schemas/NodeD" | ||
}, | ||
"complexNode": { | ||
"$ref": "#/components/schemas/ComplexNode" | ||
}, | ||
"selfReferencingNode": { | ||
"$ref": "#/components/schemas/SelfReferencingNode" | ||
}, | ||
"deepRecursiveNode": { | ||
"$ref": "#/components/schemas/DeepRecursiveNode" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"NodeA": { | ||
"type": "object", | ||
"properties": { | ||
"nodeB": { | ||
"$ref": "#/components/schemas/NodeB" | ||
} | ||
} | ||
}, | ||
"NodeB": { | ||
"type": "object", | ||
"properties": { | ||
"nodeA": { | ||
"$ref": "#/components/schemas/NodeA" | ||
} | ||
} | ||
}, | ||
"NodeC": { | ||
"type": "object", | ||
"properties": { | ||
"self": { | ||
"$ref": "#/components/schemas/NodeC" | ||
} | ||
} | ||
}, | ||
"NodeD": { | ||
"type": "object", | ||
"properties": { | ||
"nodeE": { | ||
"$ref": "#/components/schemas/NodeE" | ||
} | ||
} | ||
}, | ||
"NodeE": { | ||
"type": "object", | ||
"properties": { | ||
"nodeD": { | ||
"$ref": "#/components/schemas/NodeD" | ||
} | ||
} | ||
}, | ||
"ComplexNode": { | ||
"type": "object", | ||
"properties": { | ||
"nodeF": { | ||
"$ref": "#/components/schemas/NodeF" | ||
} | ||
} | ||
}, | ||
"NodeF": { | ||
"type": "object", | ||
"properties": { | ||
"nodeG": { | ||
"$ref": "#/components/schemas/NodeG" | ||
} | ||
} | ||
}, | ||
"NodeG": { | ||
"type": "object", | ||
"properties": { | ||
"nodeH": { | ||
"$ref": "#/components/schemas/NodeH" | ||
} | ||
} | ||
}, | ||
"NodeH": { | ||
"type": "object", | ||
"properties": { | ||
"complexNode": { | ||
"$ref": "#/components/schemas/ComplexNode" | ||
} | ||
} | ||
}, | ||
"SelfReferencingNode": { | ||
"type": "object", | ||
"properties": { | ||
"node": { | ||
"$ref": "#/components/schemas/SelfReferencingNode" | ||
} | ||
} | ||
}, | ||
"DeepRecursiveNode": { | ||
"type": "object", | ||
"properties": { | ||
"child": { | ||
"$ref": "#/components/schemas/DeepRecursiveNode" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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