jamescourtney / FlatSharp

Fast, idiomatic C# implementation of Flatbuffers
Apache License 2.0
510 stars 51 forks source link

Compatibility issue between flatc and FlatSharp #245

Closed JurjenBiewenga closed 3 years ago

JurjenBiewenga commented 3 years ago

Hi,

We've recently started working with a third party that is using our schemas, they're using flatc to compile the schemas for usage in Python. I was expecting this to work just fine as the ReadMe claims schema correctness (minus the fs_serializer bits). However we quickly ran into issues where the flatc compiler is a lot stricter on how/when properties are defined, e.g. root_type is only allowed after the type has been defined or usage of an enum can only occur later in the same file.

Of course the changes to the parsing are very useful and make life a lot easier however I think it would be good to have some sort of compatibility/strict mode where it is enforcing the (ideally) the same rules as flatc is.

TLDR: flatc schemas are compatible with FlatSharp but not necessarily the other way around.

jamescourtney commented 3 years ago

What version of FlatSharp are you using? I too observed this problem, which is why FlatSharp 6 uses flatc as its parser instead of the custom grammar that I'd used prior to version 6.

Check out the release notes here, and let me know if you're seeing this issue on V6.

JurjenBiewenga commented 3 years ago

Ah that's great to hear, we're still on 5.x. I'll look into updating sometime soon! Thanks for the great work!

jamescourtney commented 3 years ago

Sorry for my late response. Real life has hit me pretty hard the last couple of months, so FlatSharp hasn't been top of mind for me. Feel free to reach out if there are other issues. And thanks for the kind words!