Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SimdJson is not compatible with null on the path. #38

Open
heykirby opened this issue Jan 23, 2024 · 2 comments
Open

SimdJson is not compatible with null on the path. #38

heykirby opened this issue Jan 23, 2024 · 2 comments

Comments

@heykirby
Copy link

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
Copy link
Author

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

@piotrrzysko
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants