Friday, July 3, 2026
HomeiOS Developmentios - Cant decode an empty JSON swift

ios – Cant decode an empty JSON swift

[ad_1]

I’ve put up request and its give me an empty JSON {}. How am i able to decode it?

I attempted func request(for id: String, then completion: @escaping (Consequence<Knowledge, Error>) -> Void) its failed

Deadly error: typeMismatch(Basis.Knowledge,
Swift.DecodingError.Context(codingPath: [], debugDescription:
“Anticipated to decode Knowledge however discovered a dictionary as a substitute.”,
underlyingError: nil))

func request(for id: String, then completion: @escaping (Consequence<String, Error>) -> Void)

Deadly error: typeMismatch(Swift.String,
Swift.DecodingError.Context(codingPath: [], debugDescription:
“Anticipated to decode String however discovered a dictionary as a substitute.”,
underlyingError: nil))

Any and Void can not conform to ‘Decodable’

Please assist

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments