-
Notifications
You must be signed in to change notification settings - Fork 61
Add Lua-based cjson support #560
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
Conversation
} | ||
|
||
@TestTemplate | ||
@Disabled("Failed to make dkjson return nil for null values") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it will possibly require to make another one patch to dkjson sources
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Frequently, in Lua, we assume that an array ends just before its first nil element. This convention has one drawback: We cannot have a nil inside an array.
} | ||
|
||
@TestTemplate | ||
@Disabled("Failed to make dkjson return correct value for string") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it will possibly require to make a patch to dkjson sources to support such behaviour
6ec1a70
to
bbcd339
Compare
Hi thanks for the PR! Could you also try native Redis test cases for JSON https://github.com/redis/redis/blob/fdeb97629ef8964a5d9040328ee63734884ac874/tests/unit/scripting.tcl#L351 -- either by converting them to Java comparison tests or by running them directly from TCL (but I expect lots of other tests from |
closing in favor of #561 |
Partially closes #558
I tried several Lua-based Json libraries:
My favorite is dkjson: it passes almost all test cases I prepared, lib has well-written documentation and great structure to add the configuration features support:
{ "encode_sparse_array", json_cfg_encode_sparse_array },
{ "encode_max_depth", json_cfg_encode_max_depth },
{ "decode_max_depth", json_cfg_decode_max_depth },
{ "encode_number_precision", json_cfg_encode_number_precision },
{ "encode_keep_buffer", json_cfg_encode_keep_buffer },{ "encode_invalid_numbers", json_cfg_encode_invalid_numbers },
{ "decode_invalid_numbers", json_cfg_decode_invalid_numbers }