<p>根据<a href="https://github.com/google/protobuf/releases/tag/v3.0.0" rel="nofollow">the manual</a>,Protobuf 3.0.0支持JSON序列化:</p>
<blockquote>
<p>A well-defined encoding in JSON as an alternative to binary proto encoding.</p>
</blockquote>
<p><strong>我尝试了什么</strong></p>
<ul>
<li><code>json.dumps(instance)</code>引发{<cd2>}</li>
<li>寻找<code>instance.to_json()</code>(或类似)函数</li>
<li>搜索了Python文档</li>
</ul>
<p><strong>如何将Python proto对象序列化为JSON?</strong></p>