Request Bodyオブジェクト
単一のリクエストボディを記述します。
固定フィールド
| フィールド名 | タイプ | 説明 |
|---|---|---|
| 説明 | string | リクエスト本文の簡単な説明。これには使用例が含まれる可能性があります。 CommonMark 構文はリッチ テキスト表現に使用できます (MAY)。 |
| コンテンツ | Map[ string,メディア タイプ オブジェクト] | 必須。リクエスト本文の内容。キーはメディア タイプまたはメディア タイプの範囲であり、値はそれを説明します。複数のキーに一致するリクエストの場合、最も具体的なキーのみが適用されます。例: text/plain は text/* をオーバーライドします |
| 必要 | boolean | リクエストにリクエスト本文が必要かどうかを決定します。デフォルトはfalse です。 |
このオブジェクトは、仕様拡張機能を使用して拡張できます。
Request Bodyの例
参照モデル定義を含むリクエスト本文。
{
"description": "user to add to the system",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User"
},
"examples": {
"user": {
"summary": "User Example",
"externalValue": "http://foo.bar/examples/user-example.json"
}
}
},
"application/xml": {
"schema": {
"$ref": "#/components/schemas/User"
},
"examples": {
"user": {
"summary": "User example in XML",
"externalValue": "http://foo.bar/examples/user-example.xml"
}
}
},
"text/plain": {
"examples": {
"user": {
"summary": "User example in Plain text",
"externalValue": "http://foo.bar/examples/user-example.txt"
}
}
},
"*/*": {
"examples": {
"user": {
"summary": "User example in other format",
"externalValue": "http://foo.bar/examples/user-example.whatever"
}
}
}
}
}
description: user to add to the system
content:
'application/json':
schema:
$ref: '#/components/schemas/User'
examples:
user:
summary: User Example
externalValue: 'http://foo.bar/examples/user-example.json'
'application/xml':
schema:
$ref: '#/components/schemas/User'
examples:
user:
summary: User Example in XML
externalValue: 'http://foo.bar/examples/user-example.xml'
'text/plain':
examples:
user:
summary: User example in text plain format
externalValue: 'http://foo.bar/examples/user-example.txt'
'*/*':
examples:
user:
summary: User example in other format
externalValue: 'http://foo.bar/examples/user-example.whatever'
文字列値の配列である本体パラメータ:
{
"description": "user to add to the system",
"content": {
"text/plain": {
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
description: user to add to the system
required: true
content:
text/plain:
schema:
type: array
items:
type: string