Commit 08134ab
fix(serde): add schema::default_value to skip_if_default
`skip_if_default<T>` omits fields during serialization when they equal
the default value, but did not declare them as optional during
deserialization. After #95 added required field checking, this caused
LSP types using `optional_bool` (= `skip_if_default<bool>`) to reject
valid messages when clients omit proposed/newer capability fields.
Fix: add `schema::default_value` to `skip_if_default`'s annotation list
so the field is recognized as optional during deserialization. This keeps
serialization and deserialization semantics orthogonal — `skip_if` alone
remains serialization-only, `default_value` alone is deserialization-only,
and `skip_if_default` explicitly opts into both.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 2a1eb83 commit 08134ab
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
0 commit comments