Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
71e24b1
Initial check-in for System.Text.Json library and solution
ahsonkhan Nov 1, 2018
1a95dbe
Auto-generate the reference assembly
ahsonkhan Nov 1, 2018
3351e23
Provide an overview README and roadmap
ahsonkhan Nov 1, 2018
b6602f8
Change the solution GUID to be unique
ahsonkhan Nov 1, 2018
9db92d5
Fix package description nit
ahsonkhan Nov 1, 2018
8a72210
Change to MIT license instead of GPL
ahsonkhan Nov 1, 2018
d46d82e
Fix file extension of images to png
ahsonkhan Nov 1, 2018
da3d8cd
Address PR feedback and only support netcoreapp
ahsonkhan Nov 2, 2018
9c28ea6
Fix the configuration props and project files
ahsonkhan Nov 2, 2018
1add330
Add comments to the JsonTokenType enum
ahsonkhan Nov 2, 2018
2352633
Add an internal class for commonly used constants when reading JSON.
ahsonkhan Nov 2, 2018
fa41f2c
Add a comment handling enum for lenient JSON reading
ahsonkhan Nov 2, 2018
887f3f3
Add a JsonReaderOptions struct to provide extensible customization of
ahsonkhan Nov 2, 2018
bb97e67
Add a JsonReaderException class which is thrown when we see an invalid
ahsonkhan Nov 2, 2018
795bd8e
Add the skeleton for the JsonUtf8Reader ref struct and add files to
ahsonkhan Nov 2, 2018
cbaf257
Add JsonReaderState, ThrowHelper, and Strings resource file
ahsonkhan Nov 2, 2018
0bbd761
Address PR feedback, remove OS-specific configurations
ahsonkhan Nov 2, 2018
ccabdda
Complete the implementation of core JsonReader APIs for reading spans
ahsonkhan Nov 2, 2018
b3ec7d5
Update the reference assembly by auto-generating it
ahsonkhan Nov 2, 2018
2fc7ece
Add unit tests and TryGet APIs
ahsonkhan Nov 2, 2018
223ab30
Add XML comments to describe the JsonUtf8Reader at a high level
ahsonkhan Nov 2, 2018
39fa595
Merge branch 'master' of https://github.com/dotnet/corefx into AddJso…
ahsonkhan Nov 5, 2018
e85f44f
Fix config and csproj to reference S.R.CS.U from Corelib
ahsonkhan Nov 5, 2018
ae59f2d
Rename type from JsonUtf8Reader to Utf8JsonReader
ahsonkhan Nov 6, 2018
05305e0
Remove remnants of ReadOnlySequeunce related fields/properties
ahsonkhan Nov 6, 2018
5b649e2
Add the remaining TryGetValueAsX APIs
ahsonkhan Nov 6, 2018
8bb7f25
Change JsonReaderState ctor to accept JsonReaderOptions instead
ahsonkhan Nov 6, 2018
6a24093
Seal the JsonReaderException class
ahsonkhan Nov 6, 2018
b5188d7
Rename LineBytePosition to BytePositionInLine
ahsonkhan Nov 6, 2018
5d50dea
Fix typo in ArrayEndWithinObject exception message
ahsonkhan Nov 6, 2018
e4ee6f1
Capitalize the acronym JSON within exception messages.
ahsonkhan Nov 6, 2018
1c4aa4f
Override GetObjectData and add a private deserialization ctor on
ahsonkhan Nov 6, 2018
1e02e09
Be explicit with lessThan in the IndexOfAny call site
ahsonkhan Nov 6, 2018
c154053
Only use ulong when Options isn't AllowComments to align stack usage
ahsonkhan Nov 6, 2018
96df849
Rename IndexOfAny helper to IndexOfOrLessThan
ahsonkhan Nov 6, 2018
130c287
Remove stray comment and fix xml comment for BytesConsumed
ahsonkhan Nov 6, 2018
6e2dcd3
Braces everywhere
ahsonkhan Nov 6, 2018
40e66a3
Rename localCopy to localBuffer to tie it to _buffer
ahsonkhan Nov 6, 2018
e2fd647
Add IsDigit and IsHexDigit helper methods
ahsonkhan Nov 6, 2018
c23b9d8
Rename Solidus to Slash, ReverseSolidus to BackSlash, and Use Asteris…
ahsonkhan Nov 6, 2018
e220c9d
Use static encoder and avoid unnecessary allocation.
ahsonkhan Nov 6, 2018
9622303
Combine multiple TryParse calls that only differ by standardFormat
ahsonkhan Nov 6, 2018
9f7767b
Use SR.Format instead of string.Format and add debug.fail for default
ahsonkhan Nov 6, 2018
c5b323d
Make the exception as serializable and add test to BinaryFormatterTes…
ahsonkhan Nov 7, 2018
f06b098
Fix exception messages, avoid printing control characters, and remove
ahsonkhan Nov 7, 2018
991cbb9
Make sure all exception messages are consistent and that they make sense
ahsonkhan Nov 7, 2018
7f46956
Fix and add new comments, rename internal enum values, and remove
ahsonkhan Nov 7, 2018
6df3276
Throw InvalidCastException from TryGetAsX if token type doesn't match
ahsonkhan Nov 7, 2018
cb9fef7
Resolve TODOs, add issues, fix search for end of string, and remove r…
ahsonkhan Nov 7, 2018
9a5b901
Use Unicode escape sequences for non-ASCII characters in tests.
ahsonkhan Nov 7, 2018
6fd5434
Add more tests related to skipping and consuming comments.
ahsonkhan Nov 7, 2018
80ec541
Allocate the stack lazily, only when depth actually surpasses 64.
ahsonkhan Nov 7, 2018
87d6edd
Add a netcoreapp config to
ahsonkhan Nov 7, 2018
3452682
Remove unnecessary DefineConstants property in test csproj
ahsonkhan Nov 8, 2018
de267e0
Use Invariant Culture where necessary to avoid tests failing on es-ES
ahsonkhan Nov 8, 2018
e80cdbf
Fix up nits in the exception messages
ahsonkhan Nov 8, 2018
903a8c8
Add an IsTokenTypePrimitive helper method and fix comment spelling
ahsonkhan Nov 8, 2018
3d24832
Use helper, use while(true) instead of goto, and change TryGet methods
ahsonkhan Nov 8, 2018
cae7b87
Shorten CommentHandling enum values and rename Default to Disallow
ahsonkhan Nov 8, 2018
d33c7b7
Fix "is the stack empty" check in EndObject/EndArray
ahsonkhan Nov 8, 2018
21f4313
Add previous token type to state and update it when token type is not a
ahsonkhan Nov 8, 2018
4a2aa63
Include comment delimiters as part of comment token, fix Debug.Assert
ahsonkhan Nov 9, 2018
95bab37
Add helper to avoid code duplication
ahsonkhan Nov 9, 2018
c12f500
Merge branch 'master' of https://github.com/dotnet/corefx into AddJso…
ahsonkhan Nov 9, 2018
1b3d16a
Add temporary workaround for Utf8 double parsing issue
ahsonkhan Nov 9, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
<ProjectReference Include="..\..\System.Runtime.Extensions\ref\System.Runtime.Extensions.csproj" />
<ProjectReference Include="..\..\System.Runtime.Serialization.Primitives\ref\System.Runtime.Serialization.Primitives.csproj" />
<ProjectReference Include="..\..\System.Text.Json\ref\System.Text.Json.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@
using System.Xml.Xsl;
using Microsoft.CSharp.RuntimeBinder;

// System.Text.Json is a .NET Core 3.0 specific library
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ViktorHofer, please review the changes to S.R.Serialization.Formatters tests. I added a netcoreapp specific config.

#if netcoreapp
using System.Text.Json;
#endif

namespace System.Runtime.Serialization.Formatters.Tests
{
public partial class BinaryFormatterTests
Expand Down Expand Up @@ -466,6 +471,11 @@ private static IEnumerable<object[]> SerializableObjects()
var isolatedStorageException = new IsolatedStorageException("message", exception);
yield return new object[] { PopulateException(isolatedStorageException), new TypeSerializableValue[] { new TypeSerializableValue("AAEAAAD/////AQAAAAAAAAAEAQAAADJTeXN0ZW0uSU8uSXNvbGF0ZWRTdG9yYWdlLklzb2xhdGVkU3RvcmFnZUV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGAgAAADJTeXN0ZW0uSU8uSXNvbGF0ZWRTdG9yYWdlLklzb2xhdGVkU3RvcmFnZUV4Y2VwdGlvb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9uYXJ5Tm9kZQgICQoAAAACAAAAAgAAAAQFAAAAEFN5c3RlbS5FeGNlcHRpb24MAAAACUNsYXNzTmFtZQdNZXNzYWdlBERhdGEOSW5uZXJFeGNlcHRpb24HSGVscFVSTBBTdGFja1RyYWNlU3RyaW5nFlJlbW90ZVN0YWNrVHJhY2VTdHJpbmcQUmVtb3RlU3RhY2tJbmRleA9FeGNlcHRpb25NZXRob2QHSFJlc3VsdAZTb3VyY2UNV2F0c29uQnVja2V0cwEBAwMBAQEAAQABBylTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbBBTeXN0ZW0uRXhjZXB0aW9uCAgCBgsAAAAQU3lzdGVtLkV4Y2VwdGlvbgkDAAAACQ0AAAAJDgAAAAkGAAAACQcAAAAJCAAAAAAAAAAK6AMAAAkJAAAACgQKAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYTAAAABnNlY3JldAgBAQkUAAAAAQ0AAAAEAAAACRUAAAACAAAAAgAAAAEOAAAABQAAAAkLAAAABhcAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARQAAAAKAAAACAgBAAAABhgAAAADb25lCgEVAAAACgAAAAkTAAAACAEBCRoAAAABGgAAAAoAAAAICAEAAAAJGAAAAAoL", TargetFrameworkMoniker.netfx461) } };

#if netcoreapp
var jsonReaderException = new JsonReaderException("message", lineNumber: 0, bytePositionInLine: 0);
yield return new object[] { PopulateException(jsonReaderException), new TypeSerializableValue[] { new TypeSerializableValue("AAEAAAD/////AQAAAAAAAAAMAgAAAFNTeXN0ZW0uVGV4dC5Kc29uLCBWZXJzaW9uPTQuMC4w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EbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYLAAAABnNlY3JldAgBAQkMAAAAAQwAAAAKAAAACAgBAAAABg0AAAADb25lCgs=", TargetFrameworkMoniker.netcoreapp30) } };
#endif

var keyNotFoundException = new KeyNotFoundException("message", exception);
yield return new object[] { PopulateException(keyNotFoundException), new TypeSerializableValue[] { new TypeSerializableValue("AAEAAAD/////AQAAAAAAAAAEAQAAAC9TeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5LZXlOb3RGb3VuZEV4Y2VwdGlvbgwAAAAJQ2xhc3NOYW1lB01lc3NhZ2UERGF0YQ5Jbm5lckV4Y2VwdGlvbgdIZWxwVVJMEFN0YWNrVHJhY2VTdHJpbmcWUmVtb3RlU3RhY2tUcmFjZVN0cmluZxBSZW1vdGVTdGFja0luZGV4D0V4Y2VwdGlvbk1ldGhvZAdIUmVzdWx0BlNvdXJjZQ1XYXRzb25CdWNrZXRzAQEDAwEBAQABAAEHKVN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsEFN5c3RlbS5FeGNlcHRpb24ICAIGAgAAAC9TeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5LZXlOb3RGb3VuZEV4Y2VwdGlvbgYDAAAAB21lc3NhZ2UJBAAAAAkFAAAABgYAAAAZaHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbQYHAAAAFFN0YWNrVHJhY2Ugc3RyaW5nLi4uBggAAAAbUmVtb3RlIFN0YWNrVHJhY2Ugc3RyaW5nLi4uAAAAAAroAwAABgkAAAAXRXhjZXB0aW9uX0NsYXNzX1NhbXBsZXMKBAQAAAApU3lzdGVtLkNvbGxlY3Rpb25zLkxpc3REaWN0aW9uYXJ5SW50ZXJuYWwDAAAABGhlYWQHdmVyc2lvbgVjb3VudAMAADhTeXN0ZW0uQ29sbGVjdGlvb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BTeXN0ZW0uRXhjZXB0aW9uCAgCBgsAAAAQU3lzdGVtLkV4Y2VwdGlvbgkDAAAACQ0AAAAJDgAAAAkGAAAACQcAAAAJCAAAAAAAAAAK6AMAAAkJAAAACgQKAAAAOFN5c3RlbS5Db2xsZWN0aW9ucy5MaXN0RGljdGlvbmFyeUludGVybmFsK0RpY3Rpb25hcnlOb2RlAwAAAANrZXkFdmFsdWUEbmV4dAICAzhTeXN0ZW0uQ29sbGVjdGlvbnMuTGlzdERpY3Rpb25hcnlJbnRlcm5hbCtEaWN0aW9uYXJ5Tm9kZQYTAAAABnNlY3JldAgBAQkUAAAAAQ0AAAAEAAAACRUAAAACAAAAAgAAAAEOAAAABQAAAAkLAAAABhcAAAAXSW5uZXIgZXhjZXB0aW9uIG1lc3NhZ2UKCgoKCgAAAAAKABUTgAoKARQAAAAKAAAACAgBAAAABhgAAAADb25lCgEVAAAACgAAAAkTAAAACAEBCRoAAAABGgAAAAoAAAAICAEAAAAJGAAAAAoL", TargetFrameworkMoniker.netfx461) } };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<BuildConfigurations>
netstandard;
netfx;
netcoreapp;
</BuildConfigurations>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
using System.Threading;
using Xunit;

// System.Text.Json is a .NET Core 3.0 specific library
#if netcoreapp
using System.Text.Json;
#endif

namespace System.Runtime.Serialization.Formatters.Tests
{
public static class EqualityExtensions
Expand Down Expand Up @@ -158,7 +163,7 @@ public static void IsEqual(this WeakReference @this, WeakReference other, bool i
public static void IsEqual<T>(this WeakReference<T> @this, WeakReference<T> other, bool isSamePlatform)
where T : class
{
if(@this == null && other == null)
if (@this == null && other == null)
return;

Assert.NotNull(@this);
Expand Down Expand Up @@ -249,7 +254,7 @@ public static void IsEqual(this Comparer @this, Comparer other, bool isSamePlatf

Assert.NotNull(@this);
Assert.NotNull(other);

// The compareInfos are internal and get reflection blocked on .NET Native, so use
// GetObjectData to get them
SerializationInfo thisInfo = new SerializationInfo(typeof(Comparer), new FormatterConverter());
Expand All @@ -259,10 +264,10 @@ public static void IsEqual(this Comparer @this, Comparer other, bool isSamePlatf
SerializationInfo otherInfo = new SerializationInfo(typeof(Comparer), new FormatterConverter());
other.GetObjectData(otherInfo, new StreamingContext());
CompareInfo otherCompareInfo = (CompareInfo)otherInfo.GetValue("CompareInfo", typeof(CompareInfo));

Assert.Equal(thisCompareInfo, otherCompareInfo);
}

public static void IsEqual(this DictionaryEntry @this, DictionaryEntry other, bool isSamePlatform)
{
CheckEquals(@this.Key, other.Key, isSamePlatform);
Expand Down Expand Up @@ -1158,9 +1163,9 @@ @this is SocketException ||
@this is XmlSyntaxException ||
@this is ThreadAbortException) && !isSamePlatform))
{
if (!(@this is ActiveDirectoryServerDownException ||
@this is SqlException ||
@this is NetworkInformationException ||
if (!(@this is ActiveDirectoryServerDownException ||
@this is SqlException ||
@this is NetworkInformationException ||
@this is SocketException))
{
Assert.Equal(@this.ToString(), other.ToString());
Expand Down Expand Up @@ -1189,6 +1194,20 @@ public static void IsEqual(this AggregateException @this, AggregateException oth
@this.InnerExceptions.CheckSequenceEquals(other.InnerExceptions, isSamePlatform);
}

#if netcoreapp
public static void IsEqual(this JsonReaderException @this, JsonReaderException other, bool isSamePlatform)
{
if (@this == null && other == null)
return;

Assert.NotNull(@this);
Assert.NotNull(other);
IsEqual(@this as Exception, other as Exception, isSamePlatform);
Assert.Equal(@this.LineNumber, other.LineNumber);
Assert.Equal(@this.BytePositionInLine, other.BytePositionInLine);
}
#endif

public static void IsEqual(this EventArgs @this, EventArgs other, bool isSamePlatform)
{
Assert.NotNull(@this);
Expand Down Expand Up @@ -1234,7 +1253,7 @@ public static void IsEqual(this Icon @this, Icon other, bool isSamePlatform)
Assert.Equal(@this.Height, other.Height);
}

public class ReferenceComparer<T> : IEqualityComparer<T> where T: class
public class ReferenceComparer<T> : IEqualityComparer<T> where T : class
{
public bool Equals(T x, T y)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<ProjectGuid>{13CE5E71-D373-4EA6-B3CB-166FF089A42A}</ProjectGuid>
<SkipIncludeNewtonsoftJson>true</SkipIncludeNewtonsoftJson>
<Configurations>netfx-Debug;netfx-Release;netstandard-Debug;netstandard-Release</Configurations>
<Configurations>netfx-Debug;netfx-Release;netstandard-Debug;netstandard-Release;netcoreapp-Debug;netcoreapp-Release</Configurations>
<TestRuntime>true</TestRuntime>
</PropertyGroup>
<ItemGroup>
Expand Down Expand Up @@ -37,6 +37,9 @@
<ItemGroup>
<EmbeddedResource Include="BinaryFormatterTests.rd.xml" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'netcoreapp'">
<Reference Include="System.Text.Json" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
<Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
Expand Down
8 changes: 4 additions & 4 deletions src/System.Text.Json/System.Text.Json.sln
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ Global
{5F553243-042C-45C0-8E49-C739131E11C3}.Debug|Any CPU.Build.0 = netcoreapp-Debug|Any CPU
{5F553243-042C-45C0-8E49-C739131E11C3}.Release|Any CPU.ActiveCfg = netcoreapp-Release|Any CPU
{5F553243-042C-45C0-8E49-C739131E11C3}.Release|Any CPU.Build.0 = netcoreapp-Release|Any CPU
{79E7EE4E-E8DF-4D67-B103-6930DAAF6EF4}.Debug|Any CPU.ActiveCfg = netcoreapp-Debug|Any CPU
{79E7EE4E-E8DF-4D67-B103-6930DAAF6EF4}.Debug|Any CPU.Build.0 = netcoreapp-Debug|Any CPU
{79E7EE4E-E8DF-4D67-B103-6930DAAF6EF4}.Release|Any CPU.ActiveCfg = netcoreapp-Release|Any CPU
{79E7EE4E-E8DF-4D67-B103-6930DAAF6EF4}.Release|Any CPU.Build.0 = netcoreapp-Release|Any CPU
{79E7EE4E-E8DF-4D67-B103-6930DAAF6EF4}.Debug|Any CPU.ActiveCfg = netcoreapp-Windows_NT-Debug|Any CPU
{79E7EE4E-E8DF-4D67-B103-6930DAAF6EF4}.Debug|Any CPU.Build.0 = netcoreapp-Windows_NT-Debug|Any CPU
{79E7EE4E-E8DF-4D67-B103-6930DAAF6EF4}.Release|Any CPU.ActiveCfg = netcoreapp-Windows_NT-Release|Any CPU
{79E7EE4E-E8DF-4D67-B103-6930DAAF6EF4}.Release|Any CPU.Build.0 = netcoreapp-Windows_NT-Release|Any CPU
{6371299B-8F39-4A0A-A9CD-70F80FF205F6}.Debug|Any CPU.ActiveCfg = netcoreapp-Debug|Any CPU
{6371299B-8F39-4A0A-A9CD-70F80FF205F6}.Debug|Any CPU.Build.0 = netcoreapp-Debug|Any CPU
{6371299B-8F39-4A0A-A9CD-70F80FF205F6}.Release|Any CPU.ActiveCfg = netcoreapp-Release|Any CPU
Expand Down
44 changes: 44 additions & 0 deletions src/System.Text.Json/ref/System.Text.Json.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,32 @@

namespace System.Text.Json
{
public enum JsonCommentHandling : byte
{
Allow = (byte)1,
Disallow = (byte)0,
Skip = (byte)2,
}
public sealed partial class JsonReaderException : System.Exception
{
public JsonReaderException(string message, long lineNumber, long bytePositionInLine) { }
public long BytePositionInLine { get { throw null; } }
public long LineNumber { get { throw null; } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
public partial struct JsonReaderOptions
{
private object _dummy;
public System.Text.Json.JsonCommentHandling CommentHandling { get { throw null; } set { } }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that comments are the big one, but are there any other options up for consideration (e.g. single-quote strings, etc.)?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifically single-quote strings, no. For any other options, the bar is much higher and there needs to be a strong scenario that would push us to add it. Ideally, the 90%+ case is valid RFC-compliant JSON, and maybe certain variations can be built on top or worked around in user code. I would be interested in getting feedback on potential other options coupled with the scenario to drive it.

}
public partial struct JsonReaderState
{
private object _dummy;
public JsonReaderState(int maxDepth = 64, System.Text.Json.JsonReaderOptions options = default(System.Text.Json.JsonReaderOptions)) { throw null; }
public long BytesConsumed { get { throw null; } }
public int MaxDepth { get { throw null; } }
Comment thread
ahsonkhan marked this conversation as resolved.
public System.Text.Json.JsonReaderOptions Options { get { throw null; } }
Comment thread
ahsonkhan marked this conversation as resolved.
}
public enum JsonTokenType : byte
{
Comment = (byte)11,
Expand All @@ -22,4 +48,22 @@ public enum JsonTokenType : byte
String = (byte)6,
True = (byte)8,
}
public ref partial struct Utf8JsonReader
{
private object _dummy;
public Utf8JsonReader(System.ReadOnlySpan<byte> jsonData, bool isFinalBlock, System.Text.Json.JsonReaderState state) { throw null; }
public long BytesConsumed { get { throw null; } }
public int CurrentDepth { get { throw null; } }
public System.Text.Json.JsonReaderState CurrentState { get { throw null; } }
public System.Text.Json.JsonTokenType TokenType { get { throw null; } }
public System.ReadOnlySpan<byte> ValueSpan { get { throw null; } }
public bool GetBooleanValue() { throw null; }
public string GetStringValue() { throw null; }
public bool Read() { throw null; }
public bool TryGetDecimalValue(out decimal value) { throw null; }
public bool TryGetDoubleValue(out double value) { throw null; }
public bool TryGetInt32Value(out int value) { throw null; }
public bool TryGetInt64Value(out long value) { throw null; }
public bool TryGetSingleValue(out float value) { throw null; }
}
}
1 change: 1 addition & 0 deletions src/System.Text.Json/ref/System.Text.Json.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<Compile Include="System.Text.Json.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\System.Memory\ref\System.Memory.csproj" />
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion src/System.Text.Json/roadmap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,4 @@
## API Discussions & Issues

* [JsonReader API Review](https://github.com/ahsonkhan/apireviews/tree/JsonReaderReview/2018/System.Text.Json)
* Placeholder for future API proposal issues
* Placeholder for future API proposal issues
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/System.Text.Json/roadmap/images/PlantUML-license.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
' Licensed to the .NET Foundation under one or more agreements.
' The .NET Foundation licenses this file to you under the MIT license.
' See the LICENSE file in the project root for more information.
' Requires PlantUML to interpret: http://plantuml.com/
' See license info under http://plantuml.com/faq for more details

@startuml
license
@enduml
Loading