Skip to content
Permalink
Browse files

merge conflict

  • Loading branch information...
neuecc committed Jun 9, 2018
2 parents 17d15f3 + 7293f40 commit 608cf01589cb3feb225a6e51a2324a24466fdaa6
Showing with 680 additions and 217 deletions.
  1. +1 −1 README.md
  2. +3 −3 docs/Utf8Json.AspNetCoreMvcFormatter.nuspec
  3. +4 −4 docs/Utf8Json.ImmutableCollection.nuspec
  4. +4 −4 docs/Utf8Json.UnityShims.nuspec
  5. +1 −1 docs/Utf8Json.nuspec
  6. +4 −4 docs/push.bat
  7. +21 −3 sandbox/ConsoleAppNetCore/Program.cs
  8. +7 −5 sandbox/DynamicCodeDumper/Program.cs
  9. +2 −2 src/Utf8Json.AspNetCoreMvcFormatter/_AssemblyInfo.cs
  10. +2 −2 src/Utf8Json.ImmutableCollection/_AssemblyInfo.cs
  11. +1 −1 src/Utf8Json.UnityClient/Assembly-CSharp.csproj
  12. +1 −0 src/Utf8Json.UnityClient/Assets/Scripts/RuntimeUnitTestToolkit/UnitTestRunner.cs
  13. +37 −0 src/Utf8Json.UnityClient/Assets/Scripts/Tests/PirvateTest.cs
  14. +1 −0 src/Utf8Json.UnityClient/Assets/Scripts/Tests/_Loader.cs
  15. +11 −7 src/Utf8Json.UnityClient/Assets/Scripts/Utf8Json/Shims/Reflection.cs
  16. +207 −77 src/Utf8Json.UnityClient/Utf8Json.UnityClient.csproj
  17. +2 −2 src/Utf8Json.UnityShims/_AssemblyInfo.cs
  18. +0 −51 src/Utf8Json/Formatters/ExceptionFormatter.cs
  19. +2 −3 src/Utf8Json/Formatters/PrimitiveObjectFormatter.cs
  20. +80 −14 src/Utf8Json/Internal/Emit/MetaMember.cs
  21. +5 −6 src/Utf8Json/Internal/Emit/MetaType.cs
  22. +46 −0 src/Utf8Json/Internal/ReflectionExtensions.cs
  23. +2 −2 src/Utf8Json/JsonReader.cs
  24. +13 −0 src/Utf8Json/JsonSerializer.NonGeneric.cs
  25. +0 −5 src/Utf8Json/Resolvers/DynamicGenericResolver.cs
  26. +98 −9 src/Utf8Json/Resolvers/DynamicObjectResolver.cs
  27. +2 −2 src/Utf8Json/_AssemblyInfo.cs
  28. +40 −0 tests/Utf8Json.Tests/BassClassDeserializeTest.cs
  29. +32 −9 tests/Utf8Json.Tests/ExceptionTest.cs
  30. +22 −0 tests/Utf8Json.Tests/JsonReaderWriterTest.cs
  31. +29 −0 tests/Utf8Json.Tests/PrimitiveObjectFormatterTest.cs
@@ -928,7 +928,7 @@ Utf8Json.Resolvers.CompositeResolver.RegisterAndSetAsDefault(
Utf8Json.Resolvers.GeneratedResolver.Instance,
// set StandardResolver or your use resolver chain
Utf8Json.StandardResolver.Default,
Utf8Json.Resolvers.StandardResolver.Default,
);
```
@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>Utf8Json.AspNetCoreMvcFormatter</id>
<version>1.3.5</version>
<version>1.3.7</version>
<title>Utf8Json AspNetCoreMvcFormatter</title>
<authors>neuecc</authors>
<owners>neuecc</owners>
@@ -13,11 +13,11 @@
<tags>Json, Serialization, Formatter, Serializer, Unity, Xamarin, ASPNET</tags>
<dependencies>
<group targetFramework=".NETFramework4.7">
<dependency id="Utf8Json" version="1.3.5" exclude="Build,Analyzers" />
<dependency id="Utf8Json" version="1.3.7" exclude="Build,Analyzers" />
<dependency id="Microsoft.AspNetCore.Mvc.Abstractions" version="2.0.0" exclude="Build,Analyzers" />
</group>
<group targetFramework=".NETStandard2.0">
<dependency id="Utf8Json" version="1.3.5" exclude="Build,Analyzers" />
<dependency id="Utf8Json" version="1.3.7" exclude="Build,Analyzers" />
<dependency id="Microsoft.AspNetCore.Mvc.Abstractions" version="2.0.0" exclude="Build,Analyzers" />
</group>
</dependencies>
@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>Utf8Json.ImmutableCollection</id>
<version>1.3.5</version>
<version>1.3.7</version>
<title>Utf8Json Extension Resolver for ImmutableCollection</title>
<authors>neuecc</authors>
<owners>neuecc</owners>
@@ -12,15 +12,15 @@
<tags>Json, Serialization, Formatter, Serializer, Unity, Xamarin</tags>
<dependencies>
<group targetFramework=".NETFramework4.7">
<dependency id="Utf8Json" version="1.3.5" exclude="Build,Analyzers" />
<dependency id="Utf8Json" version="1.3.7" exclude="Build,Analyzers" />
<dependency id="System.Collections.Immutable" version="1.4.0" exclude="Build,Analyzers" />
</group>
<group targetFramework=".NETFramework4.5">
<dependency id="Utf8Json" version="1.3.5" exclude="Build,Analyzers" />
<dependency id="Utf8Json" version="1.3.7" exclude="Build,Analyzers" />
<dependency id="System.Collections.Immutable" version="1.4.0" exclude="Build,Analyzers" />
</group>
<group targetFramework=".NETStandard2.0">
<dependency id="Utf8Json" version="1.3.5" exclude="Build,Analyzers" />
<dependency id="Utf8Json" version="1.3.7" exclude="Build,Analyzers" />
<dependency id="System.Collections.Immutable" version="1.4.0" exclude="Build,Analyzers" />
</group>
</dependencies>
@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>Utf8Json.UnityShims</id>
<version>1.3.5</version>
<version>1.3.7</version>
<title>Utf8Json UnityShims</title>
<authors>neuecc</authors>
<owners>neuecc</owners>
@@ -12,15 +12,15 @@
<tags>Json, Serialization, Formatter, Serializer, Unity, Xamarin</tags>
<dependencies>
<group targetFramework=".NETFramework4.7">
<dependency id="Utf8Json" version="1.3.5" exclude="Build,Analyzers" />
<dependency id="Utf8Json" version="1.3.7" exclude="Build,Analyzers" />
<dependency id="System.Runtime.Serialization.Primitives" version="4.3.0" exclude="Build,Analyzers" />
</group>
<group targetFramework=".NETFramework4.5">
<dependency id="Utf8Json" version="1.3.5" exclude="Build,Analyzers" />
<dependency id="Utf8Json" version="1.3.7" exclude="Build,Analyzers" />
<dependency id="System.Runtime.Serialization.Primitives" version="4.3.0" exclude="Build,Analyzers" />
</group>
<group targetFramework=".NETStandard2.0">
<dependency id="Utf8Json" version="1.3.5" exclude="Build,Analyzers" />
<dependency id="Utf8Json" version="1.3.7" exclude="Build,Analyzers" />
<dependency id="System.Runtime.Serialization.Primitives" version="4.3.0" exclude="Build,Analyzers" />
</group>
</dependencies>
@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>Utf8Json</id>
<version>1.3.5</version>
<version>1.3.7</version>
<title>Utf8Json</title>
<authors>neuecc</authors>
<owners>neuecc</owners>
@@ -1,4 +1,4 @@
nuget push Utf8Json.1.3.5.nupkg -Source https://www.nuget.org/api/v2/package
nuget push Utf8Json.ImmutableCollection.1.3.5.nupkg -Source https://www.nuget.org/api/v2/package
nuget push Utf8Json.UnityShims.1.3.5.nupkg -Source https://www.nuget.org/api/v2/package
nuget push Utf8Json.AspNetCoreMvcFormatter.1.3.5.nupkg -Source https://www.nuget.org/api/v2/package
nuget push Utf8Json.1.3.7.nupkg -Source https://www.nuget.org/api/v2/package
nuget push Utf8Json.ImmutableCollection.1.3.7.nupkg -Source https://www.nuget.org/api/v2/package
nuget push Utf8Json.UnityShims.1.3.7.nupkg -Source https://www.nuget.org/api/v2/package
nuget push Utf8Json.AspNetCoreMvcFormatter.1.3.7.nupkg -Source https://www.nuget.org/api/v2/package
@@ -17,6 +17,19 @@ public class FooException : Exception

namespace ConsoleAppNetCore
{
public abstract class JsonDBItem
{
public int ID { get { return _id; } }
private int _id = -1;
}

public class Card : JsonDBItem
{
public string Name { get { return name; } }
private string name = "0";
}


public class CustomPoint
{
public readonly int X;
@@ -331,13 +344,18 @@ public void SetId(Guid id)
}
}

public sealed class Entry
{
public int Number { get; set; }
public Exception Exception { get; set; }
}


static unsafe void Main(string[] args)
{

var ex = new Exception("ABC", new FooException { Bar = 100 });
var json = JsonSerializer.ToJsonString(ex);
Console.WriteLine(JsonSerializer.PrettyPrint(json));
var huga = JsonSerializer.Serialize<Card>(new Card());


}

@@ -21,11 +21,13 @@ static void Main(string[] args)
//DynamicObjectResolver.Default.GetFormatter<TestShouldSerialize>();
//DynamicObjectResolver.ExcludeNullCamelCase.GetFormatter<TestShouldSerialize>();

var seq = Enumerable.Range(1, 10).Select(x => x);
DynamicObjectResolver.Default.GetFormatterDynamic(seq.GetType());
//var seq = Enumerable.Range(1, 10).Select(x => x);
//DynamicObjectResolver.Default.GetFormatterDynamic(seq.GetType());


var yahhoi = CompositeResolver.Create(new IJsonFormatter[0], new[] { StandardResolver.Default });
//var yahhoi = CompositeResolver.Create(new IJsonFormatter[0], new[] { StandardResolver.Default });

DynamicObjectResolver.ExcludeNull.GetFormatter<System.Exception>();

//DynamicObjectResolver.Default.GetFormatter<System.Collections.ICollection>();
//DynamicObjectResolver.Default.GetFormatter<Test2>();
@@ -50,13 +52,13 @@ static void Main(string[] args)

#if NET45
var a1 = (DynamicObjectResolver.Default as ISave).Save();
var a2 = (DynamicObjectResolver.ExcludeNullCamelCase as ISave).Save();
var a2 = (DynamicObjectResolver.ExcludeNull as ISave).Save();
//var a2 = DynamicUnionResolver.Instance.Save();
//var a3 = DynamicEnumResolver.Instance.Save();
//var a4 = DynamicContractlessObjectResolver.Instance.Save();
var a3 = DynamicCompositeResolver.Save();

Verify(a3);
Verify(a2);
#endif
}
}
@@ -12,5 +12,5 @@
[assembly: ComVisible(false)]

[assembly: Guid("899f8b6c-c4c7-4e8b-9875-f61fdfb630bd")]
[assembly: AssemblyVersion("1.3.5")]
[assembly: AssemblyFileVersion("1.3.5")]
[assembly: AssemblyVersion("1.3.7")]
[assembly: AssemblyFileVersion("1.3.7")]
@@ -12,5 +12,5 @@
[assembly: ComVisible(false)]

[assembly: Guid("2e7ac239-3db1-4772-9f47-5f62abb56ed0")]
[assembly: AssemblyVersion("1.3.5")]
[assembly: AssemblyFileVersion("1.3.5")]
[assembly: AssemblyVersion("1.3.7")]
[assembly: AssemblyFileVersion("1.3.7")]
@@ -55,6 +55,7 @@
<Compile Include="Assets\Scripts\RuntimeUnitTestToolkit\ChainingAssertion.Unity.cs" />
<Compile Include="Assets\Scripts\RuntimeUnitTestToolkit\UnitTestRunner.cs" />
<Compile Include="Assets\Scripts\Tests\_Loader.cs" />
<Compile Include="Assets\Scripts\Tests\PirvateTest.cs" />
<Compile Include="Assets\Scripts\Tests\SimpleTest.cs" />
<Compile Include="Assets\Scripts\Utf8Json\Attributes.cs" />
<Compile Include="Assets\Scripts\Utf8Json\Formatters\AnonymousFormatter.cs" />
@@ -63,7 +64,6 @@
<Compile Include="Assets\Scripts\Utf8Json\Formatters\DictionaryFormatter.cs" />
<Compile Include="Assets\Scripts\Utf8Json\Formatters\DynamicObjectTypeFallbackFormatter.cs" />
<Compile Include="Assets\Scripts\Utf8Json\Formatters\EnumFormatter.cs" />
<Compile Include="Assets\Scripts\Utf8Json\Formatters\ExceptionFormatter.cs" />
<Compile Include="Assets\Scripts\Utf8Json\Formatters\IgnoreFormatter.cs" />
<Compile Include="Assets\Scripts\Utf8Json\Formatters\MultiDimentionalArrayFormatter.cs" />
<Compile Include="Assets\Scripts\Utf8Json\Formatters\NullableFormatter.cs" />
@@ -1,5 +1,6 @@


using System.Reflection;
using System;
using System.Linq;
using System.Collections.Generic;
@@ -0,0 +1,37 @@
using UnityEngine;
using RuntimeUnitTestToolkit;
using System.Collections;

using System.Collections.Generic;
using System;
using Utf8Json;
using System.Text;
using System.Linq;

namespace Utf8Json.UnityClient.Tests
{
public class BassPrivate
{
int x = 0;

public int GetX()
{
return x;
}
}

public class Inherit: BassPrivate
{
public int Y;
}

public class PrivateTest
{
public void CanSerialize()
{
var foo = JsonSerializer.Deserialize<Inherit>("{\"x\":10,\"Y\":99}", Utf8Json.Resolvers.StandardResolver.AllowPrivate);
foo.Y.Is(99);
foo.GetX().Is(10);
}
}
}
@@ -13,6 +13,7 @@ public static class UnitTestLoader
public static void Register()
{
UnitTest.RegisterAllMethods<SimpleTest>();
UnitTest.RegisterAllMethods<PrivateTest>();

//#if !UNITY_METRO

@@ -191,6 +191,10 @@ internal static class ReflectionExtensions

#if !NET_4_6

static readonly BindingFlags flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance
| BindingFlags.GetField | BindingFlags.GetProperty | BindingFlags.SetField | BindingFlags.SetProperty
| BindingFlags.InvokeMethod;

public static TypeInfo GetTypeInfo(this Type type)
{
return new TypeInfo(type);
@@ -203,37 +207,37 @@ public static TypeInfo CreateTypeInfo(this TypeBuilder type)

public static MethodInfo GetRuntimeMethod(this Type type, string name, Type[] types)
{
return type.GetMethod(name, types);
return type.GetMethod(name, types); // no use flags.
}

public static MethodInfo GetRuntimeMethod(this Type type, string name)
{
return type.GetMethod(name);
return type.GetMethod(name); // no use flags.
}

public static MethodInfo[] GetRuntimeMethods(this Type type)
{
return type.GetMethods();
return type.GetMethods(flags);
}

public static PropertyInfo GetRuntimeProperty(this Type type, string name)
{
return type.GetProperty(name);
return type.GetProperty(name, flags);
}

public static PropertyInfo[] GetRuntimeProperties(this Type type)
{
return type.GetProperties();
return type.GetProperties(flags);
}

public static FieldInfo GetRuntimeField(this Type type, string name)
{
return type.GetField(name);
return type.GetField(name, flags);
}

public static FieldInfo[] GetRuntimeFields(this Type type)
{
return type.GetFields();
return type.GetFields(flags);
}

public static T GetCustomAttribute<T>(this FieldInfo type, bool inherit)

0 comments on commit 608cf01

Please sign in to comment.
You can’t perform that action at this time.