Skip to content

Commit 3e7292f

Browse files
committed
docs: Show multiple errors entries and anyOf detail in error-response docs
1 parent 87efe59 commit 3e7292f

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ array (an RFC 9457 extension member). A non-combinator failure yields a single e
892892
| `type` | string | Always `about:blank` (no per-error type URI). |
893893
| `title` | string | Always `Bad Request`. |
894894
| `status` | integer | Always `400`. |
895-
| `detail` | string | Human-readable description (a leaf message, or `matched 0 of N oneOf branches` for a combinator). |
895+
| `detail` | string | Human-readable description (a leaf message; for a combinator, `matched 0 of N oneOf branches` or `did not match any anyOf branch`). |
896896
| `errors` | array | One entry per failure; omitted when empty. Each entry has the fields below. |
897897

898898
Each `errors[]` entry:
@@ -917,7 +917,7 @@ Example body for `POST /form-echo` with `age=abc` (`age` is declared as `integer
917917
}
918918
```
919919

920-
Example body for a `oneOf` request body that matches no branch — one entry per branch,
920+
Example body for a `oneOf` request body that matches no branch — one entry per failed branch,
921921
deepest (most-likely) first:
922922

923923
``` json
@@ -927,11 +927,15 @@ deepest (most-likely) first:
927927
"status": 400,
928928
"detail": "matched 0 of 2 oneOf branches",
929929
"errors": [
930-
{ "pointer": "#/offers/0/conditions/0/itemSet/minQuantity", "keyword": "type", "detail": "expected number" }
930+
{ "pointer": "#/pet/collar/size", "keyword": "type", "detail": "expected integer" },
931+
{ "pointer": "#/pet/bark", "keyword": "type", "detail": "expected boolean" }
931932
]
932933
}
933934
```
934935

936+
When several branches fail at the same location for the same reason, those identical entries are
937+
collapsed into one — so a `oneOf` failure can show fewer entries than it has branches.
938+
935939
Other error responses:
936940

937941
- **404 Not Found** — no route matches the request path (no body).

0 commit comments

Comments
 (0)