-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Labels
Description
During the dereferencing of Response and Header Objects, certain situations may arise where resulting dereferenced graph will no longer reflect the intention of specification author.
Response Object example:
{
"openapi": "3.1.0",
"components": {
"responses": {
"201": {
"description": "201 description",
"headers": {
"Content-Type": {
"description": "The number of allowed requests in the current period",
"schema": {
"type": "integer"
}
}
}
},
"400": {
"$ref": "#/components/responses/201"
}
}
}
}
Dereferenced form:
{
"openapi": "3.1.0",
"components": {
"responses": {
"201": {
"description": "201 description",
"headers": {
"Content-Type": {
"description": "The number of allowed requests in the current period",
"schema": {
"type": "integer"
}
}
}
},
"400": {
"description": "201 description",
"headers": {
"Content-Type": {
"description": "The number of allowed requests in the current period",
"schema": {
"type": "integer"
}
}
}
}
}
}
}
The original "201" response is now listed under code "400", but original Response
metadata are still set to httpStatusCode=201. We need to remedy this by overriding metadata of
Response` after dereferencing has occured.
The same applies for Header Object
, possibly Path Item Object
and Media Type Object
Full mapping of Objects with outside context can be found here: #450