Skip to content

Replace flatbuffers with json serialization library #222

Closed
@coder137

Description

@coder137

https://github.com/nlohmann/json

Why?

  • Has easier serialization APIs for C++ STL storage
  • Can add custom types (C++ structs -> json)
  • Can output in human readable (json) and binary format (ubjson, cbor, messagepack etc)

Problems with Flatbuffers

  • Harder to create a C++ to FBS interface
  • For JSON like output need to use flexbuffers instead of flatbuffers (no array like root_type allowed)
  • Schema -> C++ conversion is harder, since there is no explicit support for hashmaps/hashtables/maps/tables.

TODO

  • Add nlohmann::json library as a submodule
  • Migrate custom_generator.fbs
  • Custom Generator Unit tests
  • Migrate target.fbs
  • Target Unit tests
  • Migrate FileGenerator and TemplateGenerator from flexbuffer to json
  • Remove flatbuffers dependency and delete third_party flatbuffers submodule
  • Update documentation for flatbuffers -> json migration

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions