メインコンテンツまでスキップ

Path Itemオブジェクト

単一パスで実行できる操作について説明します。ACL 制約のため、パス項目は空であっても構いません。パス自体は依然としてドキュメント ビューアに公開されていますが、どの操作やパラメータが利用可能であるかはドキュメント ビューアにはわかりません。

固定フィールド

フィールド名タイプ説明
$refstringこのパス項目の参照定義を許可します。参照される構造は、パス項目オブジェクトの形式でなければなりません。定義されたオブジェクトと参照されるオブジェクトの両方にパス項目オブジェクト フィールドが表示される場合、動作は未定義です。相対参照を解決するためのルールを参照してください。
まとめstringこのパス内のすべての操作に適用される、オプションの文字列の概要。
説明stringオプションの文字列説明。このパス内のすべての操作に適用されます。CommonMark 構文はリッチ テキスト表現に使用できます (MAY)。
得るOperationオブジェクトこのパス上の GET 操作の定義。
置くOperationオブジェクトこのパス上の PUT 操作の定義。
役職Operationオブジェクトこのパス上の POST 操作の定義。
消去Operationオブジェクトこのパスに対する DELETE 操作の定義。
オプションOperationオブジェクトこのパス上の OPTIONS 操作の定義。
Operationオブジェクトこのパス上の HEAD 操作の定義。
パッチOperationオブジェクトこのパスに対する PATCH 操作の定義。
痕跡Operationオブジェクトこのパス上の TRACE 操作の定義。
サーバー[Serverオブジェクト]このパス内のすべての操作を処理するための代替server配列。
パラメーター[Parameterオブジェクト| Referenceオブジェクト]このパスで説明されているすべての操作に適用できるパラメータのリスト。これらのパラメータは操作レベルでオーバーライドできますが、そこで削除することはできません。リストには重複したパラメータを含めてはなりません。一意のパラメータは、名前場所の組み合わせによって定義されます。リストは、参照オブジェクトを使用して、OpenAPI オブジェクトのコンポーネント/パラメータで定義されているパラメータにリンクできます。

このオブジェクトは、仕様拡張機能を使用して拡張できます。

Path Itemオブジェクトの例

{
"get": {
"description": "Returns pets based on ID",
"summary": "Find pets by ID",
"operationId": "getPetsById",
"responses": {
"200": {
"description": "pet response",
"content": {
"*/*": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Pet"
}
}
}
}
},
"default": {
"description": "error payload",
"content": {
"text/html": {
"schema": {
"$ref": "#/components/schemas/ErrorModel"
}
}
}
}
}
},
"parameters": [
{
"name": "id",
"in": "path",
"description": "ID of pet to use",
"required": true,
"schema": {
"type": "array",
"items": {
"type": "string"
}
},
"style": "simple"
}
]
}
get:
description: Returns pets based on ID
summary: Find pets by ID
operationId: getPetsById
responses:
'200':
description: pet response
content:
'*/*':
schema:
type: array
items:
$ref: '#/components/schemas/Pet'
default:
description: error payload
content:
'text/html':
schema:
$ref: '#/components/schemas/ErrorModel'
parameters:
- name: id
in: path
description: ID of pet to use
required: true
schema:
type: array
style: simple
items:
type: string