rsyslog / rsyslog/libfastjson

think about the "null" object representation

Open
#59 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
61
Forks
35
Avg merge
21m
Merged PRs (30d)
2

Description

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 https://github.com/json-c/json-c/issues/226

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the current null-object handling and the json_object_object_get() API mentioned in the issue, then compare the behavior with the json-c issue linked there. Define the representation and compatibility requirements before deciding what implementation and tests are needed.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
api
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.