SkipValidation when using the writer internally within the serializer. (dotnet/corefx...
authorAhson Khan <ahkha@microsoft.com>
Mon, 20 May 2019 07:21:36 +0000 (00:21 -0700)
committerGitHub <noreply@github.com>
Mon, 20 May 2019 07:21:36 +0000 (00:21 -0700)
Commit migrated from https://github.com/dotnet/corefx/commit/e58b35cd0f8fe6caa194ca7e48388d8d59854fe0

src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.MultiSegment.cs
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.cs

index afeeff5..d710800 100644 (file)
@@ -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);
index 27d2683..e78e2d3 100644 (file)
@@ -294,7 +294,10 @@ namespace System.Text.Json.Serialization
         {
             return new JsonWriterOptions
             {
-                Indented = WriteIndented
+                Indented = WriteIndented,
+#if !DEBUG
+                SkipValidation = true
+#endif
             };
         }