Also do not limit depth. It was introduced in e34fa2e915 as a simple
solution to OOM problem. In this commit we do exactly the refactoring
described there. Maximum size is the same as stack item size and
can be changed if needed withouth significat refactoring.
`1 MiB` seems sufficient, though.
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
There are 2 kinds of JSON marshaling:
1. Lossy raw marshaling, when type information is lost and
map keys are expected to be valid utf-8 strings.
2. Almost lossless marshaling, which can handle any non-recursive item.
Interop value preserves only type.
This commit implements the second.
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>