-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flatc not generating JOSN #5628
Comments
Probably, this issue already fixed by #5622. |
Yes It seems so but it fails to generate JOSN. |
I have got if (parser_.root_struct_def_ == nullptr) { return false; } |
It is impossible to generate json-schema if a root table is unknown. table test_type { inventory:[ubyte]; }
root_type test_type; |
Yes that seems to be the cause. Thanks for immediate response. closing this issue with incorrect schema definition issue. |
First of all thanks for this very impressive serialization library with quite good documentation. I'm using it for now for a year. The issue I'm creating might be a trivial but I think it is needed to be fixed at least for my usage :) . Or this might be a non issue causing due to some incorrect IDL I have written :(.
I have written simple .fbs schema file contains line as below:
table test_type { inventory:[ubyte]; }
I need to generate C++ headers for this and jsonschema as well for string representation of this data.
when I'm executing command below:
flatc has 'Segmentation fault'
The stack trace for this is as below:
` (gdb) r --jsonschema -o /tmp/fbs/ samples/test.fbs
Starting program: /usr/local/bin/flatc --jsonschema -o /tmp/fbs/ samples/test.fbs
Program received signal SIGSEGV, Segmentation fault.
0x00000000005410f0 in std::string flatbuffers::jsons::GenFullNameflatbuffers::StructDef(flatbuffers::StructDef const*) ()
(gdb) bt
#0 0x00000000005410f0 in std::string flatbuffers::jsons::GenFullNameflatbuffers::StructDef(flatbuffers::StructDef const*) ()
#1 0x00000000005428da in flatbuffers::jsons::JsonSchemaGenerator::generate() ()
#2 0x00000000005409e2 in flatbuffers::GenerateJsonSchema(flatbuffers::Parser const&, std::string const&, std::string const&) ()
#3 0x00000000005459b9 in flatbuffers::FlatCompiler::Compile(int, char const**) ()
#4 0x000000000041e46b in main ()
(gdb)
`
I have created a debug build of flatc to trace it down. It seems that there need to be a null check on below line.
Patch diff for this fix is :
Let me know if its a valid issue or there is incorrect IDL declaration.
Thanks,
Swapnil
The text was updated successfully, but these errors were encountered: