-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Closed
Labels
Milestone
Description
We should only do this if it doesn't regress JsonElement performance noticably.
runtime/src/libraries/System.Text.Json/tests/Serialization/ExceptionTests.cs
Lines 366 to 380 in d4b06b1
| [Fact] | |
| [ActiveIssue("JsonElement needs to support Path")] | |
| public static void ExtensionPropertyRoundTripFails() | |
| { | |
| try | |
| { | |
| JsonSerializer.Deserialize<ClassWithExtensionProperty>(@"{""MyNestedClass"":{""UnknownProperty"":bad}}"); | |
| Assert.True(false, "Expected JsonException was not thrown."); | |
| } | |
| catch (JsonException e) | |
| { | |
| // Until JsonElement supports populating Path ("UnknownProperty"), which will be prepended by the serializer ("MyNestedClass"), this will fail. | |
| Assert.Equal("$.MyNestedClass.UnknownProperty", e.Path); | |
| } | |
| } |
cc @steveharter
Reactions are currently unavailable