Skip to content

Commit cd4d1a5

Browse files
committed
Update migration notes
Signed-off-by: Dariusz Jędrzejczyk <2554306+chemicL@users.noreply.github.com>
1 parent 86b9151 commit cd4d1a5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

MIGRATION-2.0.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ The following records assert that their required fields are non-null at construc
9393

9494
**Action:** Audit any code that constructs these records with potentially-null values and provide valid, non-null arguments.
9595

96+
**Wire deserialization is lenient**
97+
98+
Deserialization substitutes safe defaults for absent required fields instead of failing. A `WARN` is logged for every field that was defaulted. `JSONRPCResponse.JSONRPCError` is excluded — malformed JSON-RPC error envelopes still fail immediately.
99+
96100
#### Builder API changes
97101

98102
The builder factory methods for several records now require the mandatory fields as arguments, making it impossible to obtain a builder that is already missing required state. The old no-arg `builder()` factory and the public no-arg `Builder()` constructor are deprecated and will be removed in a future release.
@@ -108,7 +112,7 @@ Two records that previously had no builder now have one with the same required-f
108112
- `ProgressNotification.builder(progressToken, progress)` — optional: `.total(Double)`, `.message(String)`, `.meta(Map)`
109113
- `JSONRPCResponse.JSONRPCError.builder(code, message)` — optional: `.data(Object)`
110114

111-
**Note:** `LoggingMessageNotification.level` must never be `null`. Because `LoggingLevel` deserialization is lenient (see the `LoggingLevel` section above), callers should ensure clients and servers send only recognized level strings.
115+
**Note:** A *missing* `level` field on the wire is handled — it defaults to `INFO` (see the wire-defaults table above). However, an *unrecognized* level string still deserializes to `null` (see the `LoggingLevel` section above), which will then fail the canonical constructor. Ensure clients and servers send only recognized level strings.
112116

113117
### Optional JSON Schema validation on `tools/call` (server)
114118

0 commit comments

Comments
 (0)