-
Leon Barrett authored
* Fix parsing empty Struct Values from Json This fixes a bug. When parsing a struct from JSON like struct = json_format.Parse('{"k": {}}', Struct()) then the struct's "k" value would end up not initialized, and accessing the value would raise an error. In[1]: struct['k'] ValueError: Value not set That seems to be because the Struct field of the Value was not set. In[2]: struct Out[2]: fields { key: "k" value { } } This commit makes sure that the Value's Struct field is initialized even if the Struct has no values itself. This commit also extends a test to cover this case. * Additionally test for empty list
9e69594a
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
compatibility_tests/v2.5.0 | ||
release/wheel | ||
MANIFEST.in | ||
README.md | ||
mox.py | ||
release.sh | ||
setup.cfg | ||
setup.py | ||
stubout.py | ||
tox.ini |