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

How to decode "null" as nil Default ! (not as rapidjson.null) #50

Closed
xtutu opened this issue Jul 3, 2020 · 0 comments
Closed

How to decode "null" as nil Default ! (not as rapidjson.null) #50

xtutu opened this issue Jul 3, 2020 · 0 comments

Comments

@xtutu
Copy link

xtutu commented Jul 3, 2020

rapidjson.null (it is actually a function)

> obj = Json.decode('{\"params\":[\"abc\",null, \"def\"]}')   
> var_dump(obj)
{
  ["params"] =   {
    [1] = "abc", 
    [2] = "function: 0x7f7736af48b0",    --  (it is function : rapidjson.null)
    [3] = "def"
  }
}
-------------------------------------

what i want is:
{
  ["params"] =   {
    [1] = "abc", 
    [2] = nil, 
    [3] = "def"
  }
}
@xtutu xtutu closed this as completed Jul 3, 2020
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

1 participant