Commit 249721b
Re-enable source generator support for inaccessible [JsonInclude] members
The System.Text.Json source generator supports inaccessible members via
UnsafeAccessor (net8+) or a reflection fallback (.NET Framework). Support
for inaccessible members annotated with [JsonInclude] was intentionally
disabled in #124650 because a workaround in the MCP SDK relied on the
omission. That dependency has since been removed
(modelcontextprotocol/csharp-sdk#1686), so this re-enables full support.
- The parser no longer forces HasJsonInclude = false for inaccessible
[JsonInclude] members and no longer reports SYSLIB1038.
- The SYSLIB1038 diagnostic descriptor and its resx/xlf strings are
removed; the diagnostic ID remains documented so it is never reused.
- Behavior tests now assert full round-trip support uniformly across
reflection and source-gen; the disabled-behavior source-gen overrides
are removed and the UnsafeAccessors_PrivateProperties baselines are
regenerated for both netcoreapp (UnsafeAccessor) and net462 (reflection).
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>1 parent e6428cb commit 249721b
25 files changed
Lines changed: 65 additions & 531 deletions
File tree
- src/libraries/System.Text.Json
- gen
- Resources
- xlf
- tests
- Common
- System.Text.Json.SourceGeneration.Tests
- Serialization
- System.Text.Json.SourceGeneration.Unit.Tests
- Baselines/UnsafeAccessors_PrivateProperties
- net462
- netcoreapp
Lines changed: 0 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | 71 | | |
80 | 72 | | |
81 | 73 | | |
| |||
Lines changed: 5 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1986 | 1986 | | |
1987 | 1987 | | |
1988 | 1988 | | |
1989 | | - | |
1990 | | - | |
1991 | | - | |
1992 | | - | |
1993 | | - | |
1994 | | - | |
1995 | 1989 | | |
1996 | 1990 | | |
1997 | 1991 | | |
| |||
2162 | 2156 | | |
2163 | 2157 | | |
2164 | 2158 | | |
2165 | | - | |
2166 | 2159 | | |
2167 | 2160 | | |
2168 | 2161 | | |
2169 | 2162 | | |
2170 | | - | |
2171 | | - | |
2172 | | - | |
2173 | | - | |
2174 | | - | |
2175 | 2163 | | |
2176 | 2164 | | |
2177 | 2165 | | |
| |||
2187 | 2175 | | |
2188 | 2176 | | |
2189 | 2177 | | |
2190 | | - | |
| 2178 | + | |
2191 | 2179 | | |
2192 | 2180 | | |
2193 | 2181 | | |
2194 | | - | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
2195 | 2185 | | |
2196 | 2186 | | |
2197 | 2187 | | |
| |||
2244 | 2234 | | |
2245 | 2235 | | |
2246 | 2236 | | |
2247 | | - | |
2248 | | - | |
2249 | | - | |
2250 | | - | |
| 2237 | + | |
2251 | 2238 | | |
2252 | 2239 | | |
2253 | 2240 | | |
| |||
2396 | 2383 | | |
2397 | 2384 | | |
2398 | 2385 | | |
2399 | | - | |
2400 | 2386 | | |
2401 | 2387 | | |
2402 | 2388 | | |
| |||
2406 | 2392 | | |
2407 | 2393 | | |
2408 | 2394 | | |
2409 | | - | |
2410 | 2395 | | |
2411 | 2396 | | |
2412 | 2397 | | |
| |||
2429 | 2414 | | |
2430 | 2415 | | |
2431 | 2416 | | |
2432 | | - | |
2433 | | - | |
2434 | | - | |
2435 | | - | |
2436 | 2417 | | |
2437 | 2418 | | |
2438 | 2419 | | |
| |||
2449 | 2430 | | |
2450 | 2431 | | |
2451 | 2432 | | |
2452 | | - | |
2453 | | - | |
2454 | | - | |
2455 | | - | |
2456 | 2433 | | |
2457 | 2434 | | |
2458 | 2435 | | |
| |||
2478 | 2455 | | |
2479 | 2456 | | |
2480 | 2457 | | |
2481 | | - | |
2482 | | - | |
2483 | | - | |
2484 | | - | |
2485 | 2458 | | |
2486 | 2459 | | |
2487 | 2460 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | 156 | | |
163 | 157 | | |
164 | 158 | | |
| |||
Lines changed: 0 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | 55 | | |
66 | 56 | | |
67 | 57 | | |
| |||
Lines changed: 0 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | 55 | | |
66 | 56 | | |
67 | 57 | | |
| |||
Lines changed: 0 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | 55 | | |
66 | 56 | | |
67 | 57 | | |
| |||
Lines changed: 0 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | 55 | | |
66 | 56 | | |
67 | 57 | | |
| |||
Lines changed: 0 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | 55 | | |
66 | 56 | | |
67 | 57 | | |
| |||
Lines changed: 0 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | 55 | | |
66 | 56 | | |
67 | 57 | | |
| |||
Lines changed: 0 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | 55 | | |
66 | 56 | | |
67 | 57 | | |
| |||
0 commit comments