Skip to content
Advertisement

Alamofire upload JSON response not compiling

I’m doing an Alamofire upload to the server and want to decode some JSON that’s sent back in response.

JavaScript

On the line where I’m guarding that data.result.value has a value (the JSON response sent from the server), I’m getting a ‘Type of expression is ambiguous without more context’.

The code to send the JSON object from the server looks like this on the Node.js side:

JavaScript

Any ideas?

Advertisement

Answer

Since you already have a codable/decodable Community struct, try this approach:

JavaScript
Advertisement