Json schema (#4369)

* Added empty generator for json schema (idl_gen_json_schema.cpp)
#4360

* JsonSchemaGenerator: output of tables implemented

current problems:
- typenames are not correct
- array types need to be deduced

#4360

* JsonSchemaGenerator: Corrected generation of typenames
Current problems: enum types not written correctly
#4360

* JsonSchemaGenerator: Added generation of enum types
#4360

* idl_gen_json_schema.cpp: Write required properties to schema
#4360

* idl_gen_json_schema.cpp: Export Types including namespace
#4360

* idl_gen_json_schema.cpp: Fixed Json format
#4360

* idl_gen_json_schema.cpp: Formatted according to google code style
#4360

* Checked in monster_test.bfbs with changes from master

* Added idl_gen_json_schema.cpp in CMakeLists.txt

* generate_code.bat: Added generation of json schema

* Added todo.md

* generate_code.sh: Added generation of json schema

* Addressed some review issues
- removed command line arg -S
- removed new lines
- fixed codestyle in template functions
- removed usage of stringstream
- idented json schema
#4360

* removed auto in idl_gen_json_schema.cpp

* idl_gen_json_schema.cpp: changed iterator declarations to auto
#4360

* deleted todo.md

* idl_gen_json_schema.cpp: Removed keyword "override" so that vs2010 can compile

* idl_gen_json_schema.cpp: switch statement in GenType handeles all enum-members

* idl_gen_json_schema.cpp: Removed cerr output

* idl_gen_json_schema.cpp: Avoid vector copying

* idl_gen_json_schema.cpp: Fixed identation of json schema output

* idl_gen_json_schema.cpp: Do not output empty descriptions
This commit is contained in:
schoetbi
2017-07-10 17:05:59 +02:00
committed by Wouter van Oortmerssen
parent 0e85eeef2c
commit f20204180d
8 changed files with 345 additions and 1 deletions

View File

@@ -96,7 +96,12 @@ int main(int argc, const char *argv[]) {
flatbuffers::IDLOptions::kPhp,
"Generate PHP files for tables/structs",
flatbuffers::GeneralMakeRule },
};
{ flatbuffers::GenerateJsonSchema, nullptr, "--jsonschema", "JsonSchema", true,
nullptr,
flatbuffers::IDLOptions::kJsonSchema,
"Generate Json schema",
flatbuffers::GeneralMakeRule },
};
flatbuffers::FlatCompiler::InitParams params;
params.generators = generators;