-
Notifications
You must be signed in to change notification settings - Fork 469
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
prost-build: Allow path globbing for type and field attributes #987
Comments
Hi @munic-mabs I don't want to blow off your idea, but I think globbing becomes complicated really fast. You can already see that in the questions you ask 😉 Did you know I think the best way to get this done in prost upstream is to work on it yourself. You might want to look at PathMap struct. This struct does the actual matching. Perhaps you could build a prototype so that we have a better idea of your solution. |
Hi,
We'd like to have the ability to add an attribute to multiple types of the same nature. An example would be to derive a custom proc-macro for all of our
Response
types. Currently, it is done manually as follows.Ideally we'd be able to do something like this.
I am not aware of any pre-existing convention/implementation concerning the globbing of Protobuf paths. It'd be interesting to be able to also support more specific cases such as
.a.b.*.*Response
which would match.a.b.c.MyResponse
.Points that might be interesting to discuss.
What if two glob patterns, i.e., two
type_attribute
calls, match a given type. What would the expected behavior in this case? I believe that the current behavior oftype_attribute
preserves only one, possibly the last, entry?How can one exclude one or more types/attributes from a globbing pattern?
Is it possible to have a publicly accessible API to retrieve the result of glob expansion for debugging purposes?
While it seems more complex, an alternative implementation could offer the ability to inject custom logic to be executed for each message parsed by prost similarly to
ServiceGenerator
assuming it does not exist already.Thank you!
The text was updated successfully, but these errors were encountered: