説明
共通の parameters 定義は、操作やパスから参照することで、そのリクエストに適用されます。未使用の定義自体がセキュリティ上の脆弱性ではありませんが、古い定義や誤った参照は整理が必要です。
想定される影響
利用者が実際のリクエストパラメーターを誤解したり、入力規則の変更時に不要な定義まで確認したりする可能性があります。
対処方法
必要なパラメーターを正しい $ref で参照してください。他の文書からの参照も確認し、不要になった定義だけを削除してください。
例
次の POST の例では、誤った参照名 limitParame を実際の定義名 limitParam に修正しています。
変更前
json
{
"swagger": "2.0",
"info": {
"title": "Simple API Overview",
"version": "1.0.0"
},
"paths": {
"/": {
"post": {
"operationId": "listVersionsv2",
"summary": "List API versions",
"responses": {
"200": {
"description": "200 response"
}
},
"parameters": [
{
"$ref": "#/parameters/limitParame"
}
]
}
}
},
"parameters": {
"limitParam": {
"name": "limit",
"in": "body",
"description": "max records to return",
"required": true,
"schema": {
"type": "string"
}
}
}
}
変更後
json
{
"swagger": "2.0",
"info": {
"title": "Simple API Overview",
"version": "1.0.0"
},
"paths": {
"/": {
"post": {
"operationId": "listVersionsv2",
"summary": "List API versions",
"responses": {
"200": {
"description": "200 response"
}
},
"parameters": [
{
"$ref": "#/parameters/limitParam"
}
]
}
}
},
"parameters": {
"limitParam": {
"name": "limit",
"in": "body",
"description": "max records to return",
"required": true,
"schema": {
"type": "string"
}
}
}
}