Skip to content

How to override or set the json value at the root of the json object ? #79

@manmohantarle

Description

@manmohantarle

Hello @tidwall

I want to achieve the following use cases using sjson.SetRaw function
use case 1 :
initialJson := [] or ``(empty json)
inputJson := [1,2,3]

resultJson should be [1,2,3]

use case 2:
initialJson := {} or ``(empty json)
inputJson := {"test":[1,2,3],"test2":"testval"}

resultJson should be {"test":[1,2,3],"test2":"testval"}

what should be the path value to achieve this using the sjson.SetRaw function ?

Thanks in advance !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions