-
Notifications
You must be signed in to change notification settings - Fork 14
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
Same table names in different namespaces not supported #180
Comments
This is definitely a bug we want to fix, though I'm not quite sure how we want to fix it. In the meantime you should be able to work around the problem by manually naming the variants. See this test for an example of how to use this syntax. |
My current thoughts on how to fix it: The current naming scheme doesn't use the namespace at all. As I see it, we have the following options:
Currently I think option 1 and 1a are a bad ideas, as it would make the common experience much worse. I am currently split between options 2, 3 and 3a. I think I am leaning towards 3, since I currently think that naming the variants is the currently feel that naming the variants is a good enough work-around. However I am definitely willing to be convinced otherwise. In any case, I think it's a good idea to implement option 3 immediately, since we would need the code to detect ambiguity for 2 and 3a as well. |
I personally think that 3a is a good solution:
2.1 fits new, small, or not yet in-use schemas. |
Workaround until planus-org/planus#180 is fixed. This change keeps compatibility with C++ and TS.
Thanks for this suggestion @TethysSvensson 👍. It helps in the meantime. |
Use aliases for Message, Request and Notification bodies. Needed for Rust[*], plus the resulting type names are much more convenient, which come with the redundant 'FBS_' prefix. [*] (planus-org/planus#180).
As you can see in the following example, having tables with the same name in different namespaces is not supported. They are reduced to one (ie: Check for
DumpResponse
).In our case we're using a quite wide schema and having namespaces make perfect sense.
.fbs schema:
The following rust code is generated:
This is the generated code for c++:
The text was updated successfully, but these errors were encountered: