From: Ahson Khan Date: Mon, 20 May 2019 07:21:36 +0000 (-0700) Subject: SkipValidation when using the writer internally within the serializer. (dotnet/corefx... X-Git-Tag: submit/tizen/20210909.063632~11031^2~1541 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8b4448329fe99941875484bafe4626adb85f6360;p=platform%2Fupstream%2Fdotnet%2Fruntime.git SkipValidation when using the writer internally within the serializer. (dotnet/corefx#37791) Commit migrated from https://github.com/dotnet/corefx/commit/e58b35cd0f8fe6caa194ca7e48388d8d59854fe0 --- diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.MultiSegment.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.MultiSegment.cs index afeeff5..d710800 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.MultiSegment.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.MultiSegment.cs @@ -2203,7 +2203,7 @@ namespace System.Text.Json if (marker != JsonConstants.Asterisk) { - ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfValueNotFound, marker); + ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfValueNotFound, JsonConstants.Slash); } return SkipMultiLineCommentMultiSegment(localBuffer.Slice(1), leftOver); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.cs index 27d2683..e78e2d3 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.cs @@ -294,7 +294,10 @@ namespace System.Text.Json.Serialization { return new JsonWriterOptions { - Indented = WriteIndented + Indented = WriteIndented, +#if !DEBUG + SkipValidation = true +#endif }; }