forked from Redocly/redoc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use refSiblings: 'preserve' when converting
swagger
As per Redocly#2067, `swagger2openapi` needs `refSiblings: 'preserve'` to bring additional fields into the converted open-api object. This makes the description field available to the `fieldSchema` objects, but it also needs to be merged into the field model to be shown in the UI.
- Loading branch information
1 parent
3d410b6
commit f0da3c5
Showing
4 changed files
with
158 additions
and
1 deletion.
There are no files selected for viewing
65 changes: 65 additions & 0 deletions
65
src/services/__tests__/fixtures/2.0/complexFieldDescriptions.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,65 @@ | ||
{ | ||
"swagger": "2.0", | ||
"info": { | ||
"title": "AA", | ||
"version": "1.0" | ||
}, | ||
"paths": { | ||
"/test": { | ||
"get": { | ||
"operationId": "test", | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"schema": { | ||
"$ref": "#/components/schemas/Box" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"definitions": { | ||
"Measurement": { | ||
"type": "object", | ||
"description": "Reusable measurement type.", | ||
"properties": { | ||
"value": { | ||
"format": "double", | ||
"description": "The numeric value of the measurement.", | ||
"type": "number" | ||
}, | ||
"uom": { | ||
"description": "The unit-of-measurement. \r\ne.g. kg, m³", | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"Box": { | ||
"type": "object", | ||
"description": "Model which contains a reused type as a field e.g. a box with dimensions.", | ||
"properties": { | ||
"weight": { | ||
"$ref": "#/definitions/Measurement", | ||
"description": "The gross weight of the box and its contents (in kg)." | ||
}, | ||
"volume": { | ||
"$ref": "#/definitions/Measurement", | ||
"description": "The volume of the box (in m3)." | ||
}, | ||
"height": { | ||
"$ref": "#/definitions/Measurement", | ||
"description": "The height of the box (in mm)." | ||
}, | ||
"width": { | ||
"$ref": "#/definitions/Measurement", | ||
"description": "The width of the box (in mm)." | ||
}, | ||
"depth": { | ||
"$ref": "#/definitions/Measurement", | ||
"description": "The depth of the box (in mm)." | ||
} | ||
} | ||
} | ||
} | ||
} |
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