-
Notifications
You must be signed in to change notification settings - Fork 533
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for issue #616 allOf fails to resolve RELATIVE ref
- Loading branch information
Showing
5 changed files
with
120 additions
and
1 deletion.
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
15 changes: 15 additions & 0 deletions
15
...es/swagger-parser/src/test/resources/allOf-relative-file-references/models/fancy_pet.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,15 @@ | ||
{ | ||
"allOf": [ | ||
{ | ||
"$ref": "./pet.json" | ||
}, | ||
{ | ||
"properties": { | ||
"breed": { | ||
"type": "string", | ||
"example": "Labrador" | ||
} | ||
} | ||
} | ||
] | ||
} |
13 changes: 13 additions & 0 deletions
13
modules/swagger-parser/src/test/resources/allOf-relative-file-references/models/pet.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,13 @@ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "integer", | ||
"format": "int64" | ||
}, | ||
"name": { | ||
"type": "string", | ||
"example": "Cooper" | ||
} | ||
} | ||
} |
84 changes: 84 additions & 0 deletions
84
modules/swagger-parser/src/test/resources/allOf-relative-file-references/parent.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,84 @@ | ||
{ | ||
"swagger": "2.0", | ||
"info": { | ||
"description": "Issue #616. This is a modified Petstore server where we have two pet definitions 1. pet and 2. fancy_pet which inherits pet using allOf." | ||
}, | ||
"host": "petstore.swagger.io", | ||
"basePath": "/v3", | ||
"paths": { | ||
"/pet": { | ||
"get": { | ||
"operationId": "getPetById", | ||
"parameters": [ | ||
{ | ||
"name": "petId", | ||
"in": "path", | ||
"required": true, | ||
"type": "integer", | ||
"format": "int64" | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"schema": { | ||
"$ref": "./models/pet.json" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/fancy-pet": { | ||
"get": { | ||
"operationId": "getFancyPetById", | ||
"parameters": [ | ||
{ | ||
"name": "fancyPetId", | ||
"in": "path", | ||
"required": true, | ||
"type": "integer", | ||
"format": "int64" | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"schema": { | ||
"$ref": "./models/fancy_pet.json" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"definitions": { | ||
"DomesticPet": { | ||
"allOf": [ | ||
{ | ||
"$ref": "./models/pet.json" | ||
}, | ||
{ | ||
"properties": { | ||
"description": { | ||
"type": "string", | ||
"example": "friendly" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"DancingPet": { | ||
"allOf": [ | ||
{ | ||
"$ref": "./models/fancy_pet.json" | ||
}, | ||
{ | ||
"properties": { | ||
"style": { | ||
"type": "string", | ||
"example": "salsa" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} |