mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 04:04:19 +00:00
add check for root_type specified for json schema generation (#5622)
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
405c64e07d
commit
cbbd6aca04
@@ -122,6 +122,7 @@ class JsonSchemaGenerator : public BaseGenerator {
|
||||
: BaseGenerator(base_generator) {}
|
||||
|
||||
bool generate() {
|
||||
if (parser_.root_struct_def_ == nullptr) { return false; }
|
||||
code_.Clear();
|
||||
code_ += "{";
|
||||
code_ += " \"$schema\": \"http://json-schema.org/draft-04/schema#\",";
|
||||
|
||||
Reference in New Issue
Block a user