Open PassKit opened 5 years ago
The openAPI spec doesn't allow that. $refs get replaced and with it all the other elements on the same level. That's not a ReDoc issue.
The suggested way to handle the above case, reusable definitions from a $ref
with different descriptions, is to use the following structure (which is valid JSON schema):
"myObject": {
"allOf": [{ "$ref": "#/definitions/path" }],
"description": "Here the description where I expected to set it"
}
However the issue I've found with ReDoc, is that the $ref
in the allOf
does not get pulled into the definition correctly.
But that issue can be found in this ticket: https://github.com/Redocly/redoc/issues/915
Take the case of the swagger below where descriptions have been added to give context to multi-purpose objects such as Date.
When rendered, these descriptions (and also titles) are ignored and referenced object's descriptions are used instead.
Should there not be a hierarchy, making it possible to override a referenced object's title and description?