Closed 3lvis closed 7 years ago
@aasatt was supposed to be used when initializing the JSONResult
.
I don't agree with this part:
if let dictionary = body as? [String: Any] {
json = JSON(dictionary)
} else if let array = body as? [[String: Any]] {
json = JSON(array)
} else if let data = body as? Data {
json = JSON(data)
} else {
json = JSON.none
}
At least it's incomplete since it will never be initialized with a Data
body.
func handleJSONRequest(...)
will always deserialize JSON data and func requestJSON
will always initialize JSONResult
with that deserialized body.
@aasatt Hi! That was a brainfart, I think this is what you wanted: https://github.com/3lvis/Networking/pull/213
Is
init(_ data:)
ever used?