[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

@@ -325,7 +325,7 @@ int FlatCompiler::Compile(int argc, const char **argv) {
} else if (arg == "--bfbs-builtins") {
opts.binary_schema_builtins = true;
} else if (arg == "--bfbs-gen-embed") {
opts.binary_schema_gen_embed= true;
opts.binary_schema_gen_embed = true;
} else if (arg == "--no-fb-import") {
opts.skip_flatbuffers_import = true;
} else if (arg == "--no-ts-reexport") {
@@ -348,10 +348,13 @@ int FlatCompiler::Compile(int argc, const char **argv) {
opts.set_empty_vectors_to_null = false;
} else if (arg == "--java-primitive-has-method") {
opts.java_primitive_has_method = true;
} else if (arg == "--cs-gen-json-serializer") {
opts.cs_gen_json_serializer = true;
} else if (arg == "--flexbuffers") {
opts.use_flexbuffers = true;
} else if(arg == "--cpp-std") {
if (++argi >= argc) Error("missing C++ standard specification" + arg, true);
} else if (arg == "--cpp-std") {
if (++argi >= argc)
Error("missing C++ standard specification" + arg, true);
opts.cpp_std = argv[argi];
} else {
for (size_t i = 0; i < params_.num_generators; ++i) {