Skip to content
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

How to collect rules from proto descriptors #145

Closed
rauanmayemir opened this issue Oct 17, 2024 · 5 comments
Closed

How to collect rules from proto descriptors #145

rauanmayemir opened this issue Oct 17, 2024 · 5 comments

Comments

@rauanmayemir
Copy link

How do I go about collecting google.api.http annotations from dynamic proto schema?
I tried to check examples, but they add HttpRules manually.

P.S: Should github discussions be enabled for this kind of questions?

@jhump
Copy link
Member

jhump commented Oct 17, 2024

What do you mean by "collecting"? If you are encountering an issue with something, could you elaborate on what you're trying and what unexpected behavior you are seeing?

@rauanmayemir
Copy link
Author

Oh, right. I want to set up gRPC-JSON transcoding for dynamic schema. I found the option vanguard.WithRules, but now I need to get those rules from proto schema.

@jhump
Copy link
Member

jhump commented Oct 18, 2024

@rauanmayemir, those are for rules that are not in the schema. So if you have RPC services defined in Protobuf that did not declare any HTTP rules, you can supply them -- like "sidecar" configuration, to map RPC services to REST even if they were not originally designed for REST.

If your options are in the schema, then just pass the descriptors when you create the services.

@rauanmayemir
Copy link
Author

rauanmayemir commented Oct 18, 2024

Understood, thanks! I want to see how it works, where exactly those routes are being set up? (the ones matching the proto schema)

@rauanmayemir
Copy link
Author

Just found a reason this didn't work. For dynamic pb schema, I also need to pass WithTypeResolver.

@jhump jhump closed this as completed Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants