[C#] support Json Serialization (#5752)

* support json serialization

* fix invalid json format.
* string must be written with double quotes.
* remove commma after the last object member.

* fix indent

* Revert "fix invalid json format."

This reverts commit d6820ed50c.

* quated string value.

* add cs-gen-json-serializer flag.

* fix preprocessor indent

* ENABLE_JSON_SERIALIZATION -> ENABLE_JSON_SERIALIZATION_TEST

* share TestBuffer method

* remove ENABLE_JSON_SERIALIZATION

* remove duplicated test data

* [windows] add nuget restore and copy test data.

* [docker mono] share msbuild settings with windows. add nuget restore and copy test data.

* add some note for json api.
This commit is contained in:
mugisoba
2020-02-11 10:43:36 +09:00
committed by GitHub
parent 8f56990f6c
commit 173e10fdf1
43 changed files with 680 additions and 42 deletions

View File

@@ -5,6 +5,7 @@
namespace NamespaceA.NamespaceB
{
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
public enum EnumInNestedNS : sbyte
{
A = 0,

View File

@@ -47,7 +47,9 @@ public struct StructInNestedNS : IFlatbufferObject
public class StructInNestedNST
{
[Newtonsoft.Json.JsonProperty("a")]
public int A { get; set; }
[Newtonsoft.Json.JsonProperty("b")]
public int B { get; set; }
public StructInNestedNST() {

View File

@@ -53,6 +53,7 @@ public struct TableInNestedNS : IFlatbufferObject
public class TableInNestedNST
{
[Newtonsoft.Json.JsonProperty("foo")]
public int Foo { get; set; }
public TableInNestedNST() {