Closed Dbigshooter closed 8 years ago
When I run the following test:
func testIssue33() {
let json = "{\"id\":121,\"active\":false}"
let object = MyObject(json: json)
let newJson = object.toJsonString()
print("back to json = \(newJson)\n\nobject description = \(object)")
}
The output will be:
back to json = {
"id" : 121,
"active" : false
}
object description = MyObject {
hash = 9956788539511
id = 121
active = 0
}
When you just print the object it will call the .description function on it to get the string representation. I will now have a look to see why it's outputting 0 instead of false...
Ah true... The boolean will be put in the dictionary as a NSCFBoolean which has a NSNumber as it's base. Let me see if I can make the .description function output it as true/false instead of a number.
This is fixed in EVReflection 3.3.3
Hi there,
I'm trying to map some simple JSON:
{"id":121,"active":false}
In the following model:
However the boolean maps to an int, I get the following output of the mapping:
Am I missing something?