mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-24 05:51:47 +00:00
support json serialization
This commit is contained in:
@@ -5,6 +5,9 @@
|
||||
namespace NamespaceA.NamespaceB
|
||||
{
|
||||
|
||||
#if ENABLE_JSON_SERIALIZATION
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
|
||||
#endif
|
||||
public enum EnumInNestedNS : sbyte
|
||||
{
|
||||
A = 0,
|
||||
|
||||
@@ -47,7 +47,13 @@ public struct StructInNestedNS : IFlatbufferObject
|
||||
|
||||
public class StructInNestedNST
|
||||
{
|
||||
#if ENABLE_JSON_SERIALIZATION
|
||||
[Newtonsoft.Json.JsonProperty("a")]
|
||||
#endif
|
||||
public int A { get; set; }
|
||||
#if ENABLE_JSON_SERIALIZATION
|
||||
[Newtonsoft.Json.JsonProperty("b")]
|
||||
#endif
|
||||
public int B { get; set; }
|
||||
|
||||
public StructInNestedNST() {
|
||||
|
||||
@@ -53,6 +53,9 @@ public struct TableInNestedNS : IFlatbufferObject
|
||||
|
||||
public class TableInNestedNST
|
||||
{
|
||||
#if ENABLE_JSON_SERIALIZATION
|
||||
[Newtonsoft.Json.JsonProperty("foo")]
|
||||
#endif
|
||||
public int Foo { get; set; }
|
||||
|
||||
public TableInNestedNST() {
|
||||
|
||||
Reference in New Issue
Block a user