-
-
Notifications
You must be signed in to change notification settings - Fork 435
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed recurive reference resolving when property referencies local co… (
#660) Co-authored-by: Anton Tolokan <[email protected]>
- Loading branch information
Showing
12 changed files
with
201 additions
and
0 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "integer", | ||
"format": "int32" | ||
}, | ||
"ref_prop_part": { | ||
"$ref": "./dataPart.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,9 @@ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"idPart": { | ||
"type": "integer", | ||
"format": "int64" | ||
} | ||
} | ||
} |
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", | ||
"required": [ | ||
"definition_reference" | ||
], | ||
"properties": { | ||
"definition_reference": { | ||
"$ref": "./data.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,9 @@ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "integer", | ||
"format": "int32" | ||
} | ||
} | ||
} |
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,46 @@ | ||
{ | ||
"openapi": "3.0.3", | ||
"info": { | ||
"title": "Reference in reference example", | ||
"version": "1.0.0" | ||
}, | ||
"paths": { | ||
"/api/test/ref/in/ref": { | ||
"post": { | ||
"requestBody": { | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "object", | ||
"properties" : { | ||
"data": { | ||
"$ref": "#/components/schemas/Request" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "Successful response", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "messages/response.json" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"Request": { | ||
"$ref": "messages/request.json" | ||
} | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
openapi3/testdata/refInLocalRefInParentsSubdir/messages/data.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,12 @@ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "integer", | ||
"format": "int32" | ||
}, | ||
"ref_prop_part": { | ||
"$ref": "./dataPart.json" | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
openapi3/testdata/refInLocalRefInParentsSubdir/messages/dataPart.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,9 @@ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"idPart": { | ||
"type": "integer", | ||
"format": "int64" | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
openapi3/testdata/refInLocalRefInParentsSubdir/messages/request.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", | ||
"required": [ | ||
"definition_reference" | ||
], | ||
"properties": { | ||
"definition_reference": { | ||
"$ref": "./data.json" | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
openapi3/testdata/refInLocalRefInParentsSubdir/messages/response.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,9 @@ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "integer", | ||
"format": "int32" | ||
} | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
openapi3/testdata/refInLocalRefInParentsSubdir/spec/openapi.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,46 @@ | ||
{ | ||
"openapi": "3.0.3", | ||
"info": { | ||
"title": "Reference in reference example", | ||
"version": "1.0.0" | ||
}, | ||
"paths": { | ||
"/api/test/ref/in/ref": { | ||
"post": { | ||
"requestBody": { | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "../messages/request.json" | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "Successful response", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"ref_prop": { | ||
"$ref": "#/components/schemas/Data" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"Data": { | ||
"$ref": "../messages/data.json" | ||
} | ||
} | ||
} | ||
} |