Skip to content

Commit 3cfc2b0

Browse files
committed
docs: Fix README inaccuracies on parser selection and form value types
- Selection is by the full media type (type/subtype), not the RFC 9110 subtype. Note that lookup is case-insensitive. - After coercion, form list values are not strictly List<String> — an integer-array property yields List<Long>, etc. Describe the pre- and post-coercion shape correctly.
1 parent 89cb890 commit 3cfc2b0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,12 @@ The rest is identical.
102102

103103
### Request body content types
104104

105-
The server reads `requestBody.content` from the spec and selects a parser by `Content-Type` subtype:
105+
The server reads `requestBody.content` from the spec and selects a parser by the request's media type (the bare `type/subtype` from `Content-Type`, e.g. `application/json`; lookup is case-insensitive):
106106

107107
| Content type | Parser | Coercion |
108108
| ------------------------------------- | ---------------------------------------------------------------------------- | -------- |
109109
| `application/json` | Caller-supplied `JsonMapper` | No — strict against the schema |
110-
| `application/x-www-form-urlencoded` | Built-in. `Map<String, Object>` (string or `List<String>` for repeated keys) | Yes — field values coerced to the property schema type (integer / number / boolean / array of those) |
110+
| `application/x-www-form-urlencoded` | Built-in. `Map<String, Object>`. A single value is a `String`; repeated keys produce a `List`. After coercion the element type tracks the schema (e.g. an `integer` array yields `List<Long>`). | Yes — field values coerced to the property schema type (integer / number / boolean / array of those) |
111111
| `text/plain` | Built-in. Decoded `String` | No — schema should be `type: string` |
112112

113113
Form-field coercion mirrors the rules already used at the parameter boundary: the wire is string-only by definition, so a property typed as `integer` accepts `"42"` and yields `42`. Coercion failures surface as RFC-7807 `400` responses with a JSON-pointer to the failing field.

0 commit comments

Comments
 (0)