prototool | Your Swiss Army Knife for Protocol Buffers
kandi X-RAY | prototool Summary
kandi X-RAY | prototool Summary
Your Swiss Army Knife for Protocol Buffers
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of prototool
prototool Key Features
prototool Examples and Code Snippets
Community Discussions
Trending Discussions on prototool
QUESTION
I'm trying to figure out if a protobuf descriptor or object can be converted to JSON/Dict Python object from a pb2
file generated by prototool
. This is what I have done so far:
- I wrote a
config.proto
file withTopConfig
as my message. - I ran
prototool generate config.proto
to generateconfig_pb2.py
. - Now I want to generate a JSON/Dict object in Python with default values for
TopConfig
ANSWER
Answered 2021-Apr-01 at 20:58Ok, so I figured it out on my own.
My mistake was that my TopConfig
only had other messages
nested within it but didn't have other data fields. MessageToDict
will only work with unnested messages
, and it will not show enum
and oneof
data as well.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install prototool
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page