jberstler commented on a change in pull request #1: Swift 4 support
URL:
https://github.com/apache/incubator-openwhisk-runtime-swift/pull/1#discussion_r162830349
##########
File path: tests/dat/actions/SwiftyRequest/Sources/main.swift
##########
@@ -18,22 +18,19 @@ func main(args: [String:Any]) -> [String:Any] {
request.responseData(queryItems: [URLQueryItem(name: "hour", value: "9")])
{ response in
switch response.result {
case .success(let retval):
- guard let decoded = try? JSONSerialization.jsonObject(with:
retval, options: []),
- let json = decoded as? [String: Any] else {
- resp = ["error":"Response from server is not a dictionary"]
- semaphore.signal()
- return
+ if let json = try? JSONSerialization.jsonObject(with: retval,
options: []) as! [String:Any] {
+ resp = json
+ } else {
+ resp = ["error":"Response from server is not a dictionary
like"]
Review comment:
? ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services