読み方のヒント
矢印ボタン(または ← → キー)でページを移動できます。
個数に11を送ると、次の応答が返ります。
{
"detail": [
{
"type": "less_than_equal",
"loc": ["body", "items", 0, "quantity"],
"msg": "Input should be less than or equal to 10",
"input": 11,
"ctx": {"le": 10}
}
]
}
| 項目 | この例 | 意味 |
|---|---|---|
loc | ["body", "items", 0, "quantity"] | 場所。本文の items の0番目の quantity |
msg | Input should be less than or equal to 10 | 理由。10以下である必要がある |
input | 11 | 送られた値 |
type | less_than_equal | 理由の種類を表す名前 |
loc は、外側から順に場所をたどったリストです。0 はリストの添字なので、1つめの明細を指します。
よく出る type と msg を並べます。
type | msg の意味 |
|---|---|
missing | 必須の項目がない |
int_type | 整数ではない |
greater_than_equal | 指定の値以上である必要がある |
less_than_equal | 指定の値以下である必要がある |
string_too_short | 文字数が足りない |
too_short | リストの要素の数が足りない |
timezone_aware | 日時に時差がない |
detail はリストです。誤りが複数あると、1つずつ並びます。全部を直してから送り直します。
14 / 20