-
Notifications
You must be signed in to change notification settings - Fork 132
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
Automatic message registry #131
Comments
I've seen this from a different perspective so far: Users have to import to register anyway - so it can just as well be completely explicit. This works out best in C#, where users can easily scan an assembly for messages and register. No funny import side effects, no need to maintain. I see your point though, and think this is beneficial. It would just need
It would also need proper testing, and a documentation update. I'm super constrained at the moment, but if you could PR this I can take care of the docs. |
@timostamm I'll try to PR this weekend |
Is this still something that we want? I had to implement that for us, if you'd be interested I could upstream that. In that case, I'd like some pointer on where to put the test for that, I'd guess into |
Hey Sebastian, I'd love to hear what approach you took. Is it similar to the |
Pretty much, I added a PR. |
It will be hugely beneficial if we can create a registry of all proto messages automatically so that we don't need to pass
typeRegistry
for theAny
type which is kind of annoying and hard to maintain.The protobuf golang implementation does exactly this, whenever a proto generated file is imported it has line at the top of the file, something like:
in fact the
Any
types are always automatically handled as far as the file is imported (and registered).Definately a great development experience.
We can of course keep the
typeRegistry
option if we ever need to pass those manually in, otherwise it passes the registry by defaultThe text was updated successfully, but these errors were encountered: