Commit 3f14c919 authored by Craig Citro's avatar Craig Citro
Browse files

Fix a nasty encoding corner case with JsonValue.

The json encoding code in protorpc had a bit of custom logic to handle the
case of repeated vs. non-repeated fields with the same line of code. However,
in the case of a JsonValue (aka `any` type in a discovery doc), it's possible
for a non-repeated value to itself be a list. In this case, we'd always
deserialize the whole list, and then ... only use the last value.

The fix here is to actually simplify the code a bit, and split the logic based
on whether the field is repeated, *not* whether the value is itself a list.

Also added a simple test.
parent 58dfc187
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment