I have a json which is as follows:
{
"parameters": {
"key1": {
"value": "someStringValue"
},
"key2": {
"innerKey1": {
"innerKey2": {
"innerKey3": "someStringValue"
},
}
}
"key4": {
"value": 123
},
"key5": {
"value": true
},
}
}
As you can see I can have different kind of values (string, map, int, bool). Following is the struct I've defined:
type TestStruct struct {
Parameters map[string]ParameterValue
}
type ParameterValue struct {
Values map[string]interface{}
}
With this I'm facing issues when parsing the json,key1,key2,key3
are not being marshalled and their value is nil
. What should be the correct struct design for this ?