According to the JSON standard RFC 7159, this is valid json:
22
How do I decode this into an Int using swift4\'s decodable? This does not w
In iOS 13.1+ and macOS 10.15.1+ JSONDecoder can handle primitive types on root level.
JSONDecoder
See the latest comments (Oct 2019) in the linked article underneath Martin's answer.