simdjson-java icon indicating copy to clipboard operation
simdjson-java copied to clipboard

SimdJson is not compatible with null on the path.

Open heykirby opened this issue 1 year ago • 2 comments
trafficstars

for example json: { "field1": { "field2": "xx" } }

SimdJsonParser parser = new SimdJsonParser();\n JsonValue value = parser.parse(json.getBytes(), json.length()); value.get("field1").get("field3").toString(); image The above program will throw a null pointer exception during runtime. but jackson is compatible with this situation.

heykirby avatar Jan 23 '24 03:01 heykirby

I have some code optimizations that I hope can be merged into the main branch https://github.com/heykirby/ProtoJson/blob/simdkson/src/main/java/org/simdjson/SimdKsonParser.java

heykirby avatar Jan 23 '24 03:01 heykirby

for example json: { "field1": { "field2": "xx" } }

SimdJsonParser parser = new SimdJsonParser();\n JsonValue value = parser.parse(json.getBytes(), json.length()); value.get("field1").get("field3").toString(); image The above program will throw a null pointer exception during runtime. but jackson is compatible with this situation.

The library doesn't claim compatibility with Jackson, so I'd say that what you described is not a bug. On the other hand, I'm aware of the lack of proper documentation describing the API, guarantees, etc. Adding documentation is definitely on the project roadmap. Can you please describe why you would like to have compatibility with Jackson? What is your use case?

I have some code optimizations that I hope can be merged into the main branch https://github.com/heykirby/ProtoJson/blob/simdkson/src/main/java/org/simdjson/SimdKsonParser.java

Please submit PR(s) with them. A description providing information on what they improve would also be helpful.

piotrrzysko avatar Mar 03 '24 15:03 piotrrzysko