Convert existing JSON blob to FlatBuffer

533 views
Skip to first unread message

Martin Ostrovsky

unread,
Apr 9, 2015, 11:37:25 AM4/9/15
to flatb...@googlegroups.com
Hello,

I have large JSON blobs on disk that I'd like to convert to FlatBuffers. Is that possible to do directly or do I have to create the schema first and then construct the FlatBuffer by iterating over my existing JSON structure? 

Wouter van Oortmerssen

unread,
Apr 10, 2015, 12:33:11 PM4/10/15
to Martin Ostrovsky, flatb...@googlegroups.com
You should be able to do it directly. Construct a schema for it, then use the flatc tool to convert it from a json blob to a binary blob. You can then load that binary blob as a flatbuffer.

FlatBuffer JSON is more strict than regular JSON, i.e. you can't have a field that's an int in one instance and an object in another, for example.

On Thu, Apr 9, 2015 at 8:37 AM, Martin Ostrovsky <martin.o...@gmail.com> wrote:
Hello,

I have large JSON blobs on disk that I'd like to convert to FlatBuffers. Is that possible to do directly or do I have to create the schema first and then construct the FlatBuffer by iterating over my existing JSON structure? 

--
You received this message because you are subscribed to the Google Groups "FlatBuffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flatbuffers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages