Subject: Re: [PATCHv3 iproute2-next 3/7] iproute_lwtunnel: add options support for erspan metadata

From: David Ahern <[email-masked]>
Date: Mon, 27 Apr 2020 06:38:03 -0600

On 4/23/20 12:03 PM, Jakub Kicinski wrote:
> On Thu, 23 Apr 2020 08:23:51 -0700 Stephen Hemminger wrote:
>>  3. If non json uses hex, then json should use hex
>>     json is type less so { "ver":2 } and { "ver":"0x2" } are the same
> 
> I may be missing something or misunderstanding you, but in my humble
> experience that's emphatically not true:
> 
> $ echo '{ "a" : 2 }' | python -c 'import sys, json; print(json.load(sys.stdin)["a"] + 1)'
> 3
> $ echo '{ "a" : "2" }' | python -c 'import sys, json; print(json.load(sys.stdin)["a"] + 1)'
> Traceback (most recent call last):
>   File "<string>", line 1, in <module>
> TypeError: can only concatenate str (not "int") to str
> 

I don't know which site is the definitive source for json, but several
do state json has several types - strings, number, true / false / null,
object, array.