-
Notifications
You must be signed in to change notification settings - Fork 403
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Deserializing fastjson JSONObject error.
Expected behavior
It should deserialize to a JSONObject.
To Reproduce
fastjson version: 1.2.68.noneautotype
fury version: 0.3.1
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import io.fury.Fury;
import io.fury.config.CompatibleMode;
import io.fury.config.Language;
public class SerializationUtilTest {
@Test
public void testEncodeDecode() {
Fury fury =
Fury.builder()
.withLanguage(Language.JAVA)
.withRefTracking(true)
.requireClassRegistration(false)
.withCompatibleMode(CompatibleMode.SCHEMA_CONSISTENT)
.withCompatibleMode(CompatibleMode.COMPATIBLE)
.withAsyncCompilation(true)
.build();
String json =
"{\"vectors\":{\"dim128\":[{\"fieldNames\":[],\"opCode\":\"userDefine\",\"value\":[[0,1,2,3],[10,11,12,13],[20,21,22,23]],\"key\":\"sample_pic_vector\",\"version\":\"B1\"},{\"fieldNames\":[],\"opCode\":\"test_code\",\"value\":[[1,2,3,4,5],[11,12,13,14,15]],\"key\":\"test_key\",\"version\":\"B2\"}]}}";
JSONObject jObj = (JSONObject) JSON.parse(json);
JSONObject vectors = jObj.getJSONObject("vectors");
byte[] data = fury.serialize(vectors);
Object ret = fury.deserialize(data);
}
}Environment (please complete the following information):
Please specify the versions of Fury, OS, and others such as JDK/Python/Gcc/Clang/Go/NodeJS if they are used.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
