Commit cbbd6aca authored by Dmitry's avatar Dmitry Committed by Wouter van Oortmerssen

add check for root_type specified for json schema generation (#5622)

parent 405c64e0
...@@ -122,6 +122,7 @@ class JsonSchemaGenerator : public BaseGenerator { ...@@ -122,6 +122,7 @@ class JsonSchemaGenerator : public BaseGenerator {
: BaseGenerator(base_generator) {} : BaseGenerator(base_generator) {}
bool generate() { bool generate() {
if (parser_.root_struct_def_ == nullptr) { return false; }
code_.Clear(); code_.Clear();
code_ += "{"; code_ += "{";
code_ += " \"$schema\": \"http://json-schema.org/draft-04/schema#\","; code_ += " \"$schema\": \"http://json-schema.org/draft-04/schema#\",";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment