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

think about the "null" object representation #59

Open
rgerhards opened this issue Apr 9, 2016 · 1 comment
Open

think about the "null" object representation #59

rgerhards opened this issue Apr 9, 2016 · 1 comment
Milestone

Comments

@rgerhards
Copy link
Member

currently (inherited from json-c), the null object is implemented differently from any other objects. It's not a struct json_object (ptr), but rather C NULL. This is inconsistent, and causes some trouble with the API (e.g. json_object_object_get(), which was deprecated for that reason). This also means that all callers need to handle the null object differently.

We should at least consider the represent the null object differently. A natural choice would be to do it just like with any other object with only the type set to fjson_type_null.

see also json-c/json-c#226

@rgerhards rgerhards added this to the 1.0.0 milestone Apr 9, 2016
@ilyash-b
Copy link

I strongly recommend that JSON "null" will not be represented as C NULL. They are semantically different things. Keeping it C NULL will perpetuate all the regular problem that come from semantic misrepresentation: more code and more convoluted code to handle that object.

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