* [core]: fix writing of JSON with empty value as last