Commit c945712
authored
Update AoT, Add Roslyn 5.0, Update serialisation (#2062)
* Fix recent issue regressions, refresh examples, and document behavior
* Fix example analyzer wiring for project-reference builds
* Improve source-generator-first AOT guidance and add Roslyn 5 support
* Add trimming annotations to public API
Add System.Diagnostics trimming annotations to public API surface used via reflection: mark methods that use reflection with RequiresUnreferencedCode and annotate Type/generic parameters with DynamicallyAccessedMembers to preserve invoked members when trimming. Update approval test snapshots for .NET 9.0 and 10.0 to reflect the new attributes.
* Add Newtonsoft JSON serializer tests and deps
Import Newtonsoft.Json/Reflection in SerializedContentTests. Introduce several tests for NewtonsoftJsonContentSerializer: handling null content, GetFieldNameForProperty returning attribute-defined names, returning null when no JsonProperty attribute exists, and throwing on null input. Add a helper model (NewtonsoftFieldNameModel) used by the new tests.
* Add XML docs and generic IRequestBuilder APIs
Add XML documentation and trimming remarks throughout RequestBuilder and IRequestBuilder, and introduce a generic IRequestBuilder<T> marker interface. Expand RequestBuilder with documented ForType overloads (generic and non-generic) and add guidance about reflection, trimming/linking (RequiresUnreferencedCode and DynamicallyAccessedMembers annotations), and usage notes. Changes improve discoverability, provide trimming safety guidance, and expose typed request-builder APIs for generating strongly-typed HTTP client calls.
* Add System.Text.Json content serializer tests
Introduce comprehensive unit tests for SystemTextJsonContentSerializer: field name resolution, default JsonSerializerOptions behavior for untyped/object values, enum serialization/deserialization edge cases (camelCase, case-insensitive, numeric, null/empty, invalid tokens), and use of source-generated metadata with a custom resolver. Add supporting types and contexts: SystemTextFieldNameModel, ObjectValueContainer, CamelCaseEnum, and ObjectValueContainerJsonSerializerContext, plus a SystemTextJsonSerializer alias for System.Text.Json.JsonSerializer.1 parent cfe6862 commit c945712
16 files changed
Lines changed: 969 additions & 88 deletions
File tree
- InterfaceStubGenerator.Roslyn50
- Refit.Tests
- API/_snapshots
- Refit
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1335 | 1335 | | |
1336 | 1336 | | |
1337 | 1337 | | |
1338 | | - | |
| 1338 | + | |
1339 | 1339 | | |
1340 | | - | |
1341 | | - | |
| 1340 | + | |
1342 | 1341 | | |
1343 | 1342 | | |
1344 | 1343 | | |
| |||
1365 | 1364 | | |
1366 | 1365 | | |
1367 | 1366 | | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
1368 | 1399 | | |
1369 | 1400 | | |
1370 | 1401 | | |
| |||
Lines changed: 12 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| 240 | + | |
| 241 | + | |
240 | 242 | | |
241 | 243 | | |
242 | 244 | | |
| |||
405 | 407 | | |
406 | 408 | | |
407 | 409 | | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
418 | 420 | | |
419 | 421 | | |
420 | 422 | | |
| |||
Lines changed: 19 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
| 239 | + | |
| 240 | + | |
239 | 241 | | |
240 | 242 | | |
241 | 243 | | |
| |||
367 | 369 | | |
368 | 370 | | |
369 | 371 | | |
| 372 | + | |
| 373 | + | |
370 | 374 | | |
371 | | - | |
372 | | - | |
373 | | - | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
374 | 380 | | |
375 | 381 | | |
376 | 382 | | |
| |||
400 | 406 | | |
401 | 407 | | |
402 | 408 | | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
413 | 419 | | |
414 | 420 | | |
415 | 421 | | |
| |||
0 commit comments