|
|
|
|
|
by JOnAgain
4698 days ago
|
|
This, to me, looks like an example of relying on a nondeterministic implementation. To my knowledge, the standard doesn't prescribe that parsers take the second/last of a duplicate key. As a result, this is relying on implementation-specific choices which can lead to a terrible upgrade process. Switch to a different JSON parser, does it still work? probably. but I wouldn't bet that much. If I were implementing a JSON parser, might I throw an error on a duplicate key? maybe. Maybe I would just print a warning? If I were every going to give someone advice it would be to never do this. |
|