When trying to set an array nested in my JSON to an empty array, nothing is happening.
let json = JSON(["array": [1, 2, 3]])
json["array"] = JSON([])
json["array"].array = JSON([])
json["array"].arrayObject = []
print(json) // ["array": [1, 2, 3]]
I currently have to do this to get it to properly set the array:
var json = JSON(["array": [1, 2, 3]])
var dict = json.dictionaryObject
dict["array"] = []
json = JSON(dict)
This error is occurring using version 3.1.4.
When trying to set an array nested in my
JSONto an empty array, nothing is happening.I currently have to do this to get it to properly set the array:
This error is occurring using version
3.1.4.