简体   繁体   中英

Converting .proto to Json or yaml

New to protobuf. I have a bunch of .proto files which defines numerous endpoints. I would like to programmatically extract the endpoint definitions along with other method data defined in the endpoint specs. Is there an easy way to do this ?

Interesting question.

I'm unaware of any tools like jq for JSON and yq for YAML for processing|querying protos but it would be a useful tool to have.

I think there are probably tools out there that can help with the documentation aspect of protos but I've not used any. The folks at Buf are doing some interesting work. Theirschema registry may be of interest? I've not used it.

Otherwise, you could one of the SDKs that supports reflection (eg Go's v2 SDK supports this ) and build a solution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM