Add generation of JSON Schema to library (#6165)

* Fix C/C++ Create<Type>Direct with sorted vectors

If a struct has a key the vector has to be sorted. To sort the vector
you can't use "const".

* Changes due to code review

* Improve code readability

* Add generate of JSON schema to string to lib

* option indent_step is supported

* Remove unused variables

* Fix break in test

* Fix style to be consistent with rest of the code
This commit is contained in:
tira-misu
2020-10-16 00:28:25 +02:00
committed by GitHub
parent 5be777e1d4
commit 5cd7137103
2 changed files with 68 additions and 35 deletions

View File

@@ -1008,6 +1008,10 @@ extern bool GenerateText(const Parser &parser, const void *flatbuffer,
extern bool GenerateTextFile(const Parser &parser, const std::string &path,
const std::string &file_name);
// Generate Json schema to string
// See idl_gen_json_schema.cpp.
extern bool GenerateJsonSchema(const Parser &parser, std::string *json);
// Generate binary files from a given FlatBuffer, and a given Parser
// object that has been populated with the corresponding schema.
// See code_generators.cpp.