Skip to content

Commit 93d04a7

Browse files
authored
Respect json settings in ToObject (#693)
1 parent 61d87b1 commit 93d04a7

13 files changed

+46
-14
lines changed

docs/serializer-settings.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ public Task ScopedSerializerFluent()
476476
.AddExtraSettings(_ => _.TypeNameHandling = TypeNameHandling.All);
477477
}
478478
```
479-
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3207-L3234' title='Snippet source file'>snippet source</a> | <a href='#snippet-scopedserializer' title='Start of snippet'>anchor</a></sup>
479+
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3223-L3250' title='Snippet source file'>snippet source</a> | <a href='#snippet-scopedserializer' title='Start of snippet'>anchor</a></sup>
480480
<!-- endSnippet -->
481481

482482
Result:
@@ -967,7 +967,7 @@ public Task WithObsoleteProp()
967967
return Verify(target);
968968
}
969969
```
970-
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3172-L3193' title='Snippet source file'>snippet source</a> | <a href='#snippet-withobsoleteprop' title='Start of snippet'>anchor</a></sup>
970+
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3188-L3209' title='Snippet source file'>snippet source</a> | <a href='#snippet-withobsoleteprop' title='Start of snippet'>anchor</a></sup>
971971
<!-- endSnippet -->
972972

973973
Result:
@@ -1015,7 +1015,7 @@ public Task WithObsoletePropIncludedFluent()
10151015
.IncludeObsoletes();
10161016
}
10171017
```
1018-
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3143-L3170' title='Snippet source file'>snippet source</a> | <a href='#snippet-withobsoletepropincluded' title='Start of snippet'>anchor</a></sup>
1018+
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3159-L3186' title='Snippet source file'>snippet source</a> | <a href='#snippet-withobsoletepropincluded' title='Start of snippet'>anchor</a></sup>
10191019
<!-- endSnippet -->
10201020

10211021
Or globally:
@@ -1025,7 +1025,7 @@ Or globally:
10251025
```cs
10261026
VerifierSettings.IncludeObsoletes();
10271027
```
1028-
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3136-L3140' title='Snippet source file'>snippet source</a> | <a href='#snippet-withobsoletepropincludedglobally' title='Start of snippet'>anchor</a></sup>
1028+
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3152-L3156' title='Snippet source file'>snippet source</a> | <a href='#snippet-withobsoletepropincludedglobally' title='Start of snippet'>anchor</a></sup>
10291029
<!-- endSnippet -->
10301030

10311031
Result:
@@ -1421,7 +1421,7 @@ public Task CustomExceptionPropFluent()
14211421
.IgnoreMembersThatThrow<CustomException>();
14221422
}
14231423
```
1424-
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3029-L3048' title='Snippet source file'>snippet source</a> | <a href='#snippet-ignoremembersthatthrow' title='Start of snippet'>anchor</a></sup>
1424+
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3045-L3064' title='Snippet source file'>snippet source</a> | <a href='#snippet-ignoremembersthatthrow' title='Start of snippet'>anchor</a></sup>
14251425
<!-- endSnippet -->
14261426

14271427
Or globally:
@@ -1431,7 +1431,7 @@ Or globally:
14311431
```cs
14321432
VerifierSettings.IgnoreMembersThatThrow<CustomException>();
14331433
```
1434-
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3022-L3026' title='Snippet source file'>snippet source</a> | <a href='#snippet-ignoremembersthatthrowglobal' title='Start of snippet'>anchor</a></sup>
1434+
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3038-L3042' title='Snippet source file'>snippet source</a> | <a href='#snippet-ignoremembersthatthrowglobal' title='Start of snippet'>anchor</a></sup>
14351435
<!-- endSnippet -->
14361436

14371437
Result:

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ public Task VerifyJsonJToken()
354354
return Verify(target);
355355
}
356356
```
357-
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2915-L2950' title='Snippet source file'>snippet source</a> | <a href='#snippet-verifyjson' title='Start of snippet'>anchor</a></sup>
357+
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2931-L2966' title='Snippet source file'>snippet source</a> | <a href='#snippet-verifyjson' title='Start of snippet'>anchor</a></sup>
358358
<!-- endSnippet -->
359359

360360
Results in:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"$ref": "#/no/ref"
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"$type": "MyNamespace.User, MyAssembly"
3+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
$ref: #/no/ref
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
$type: MyNamespace.User, MyAssembly
3+
}

0 commit comments

Comments
 (0)