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.
Loading
Please sign in to comment