Why does the following code give me the error:
Invalid type in JSON write (_SwiftValue).
The error is thrown on this line:
I had this problem and it was because one of my strings was Optional. It was trying to serialize a value like: "Optional(\"string value\")"
Instead of "string value"