Why does the following code give me the error:
Invalid type in JSON write (_SwiftValue).
The error is thrown on this line:
Just in case anyone is still having problems and is using Enums, another cause may be if you are passing an Enum value and not it's rawValue.
Example:
enum Status: String {
case open
case closed
}
instead of passing the enum:
params = ["status": Status.open]
pass
params = ["status": Status.open.rawValue]