sdk-for-swift icon indicating copy to clipboard operation
sdk-for-swift copied to clipboard

Dangerous json parse operation

Open ftp27 opened this issue 2 years ago • 1 comments

https://github.com/appwrite/sdk-for-swift/blob/51f325b11ea10949cf12af363fc5fb4f652abbf2/Sources/AppwriteModels/Document.swift#L66

Not long ago, I updated libraries and encountered a crash during the parsing attempt. My old implementation was harmless because, in the event of a failed parse, I would simply return nil from the init method. This occurred when the server processed new data, and a failed parse was necessary for filtration purposes. Now, we need to utilize this parser, which even doesn't provide me with the opportunity to handle errors. Is it possible to remove the exclamation mark (!) from this line?

ftp27 avatar Jun 28 '23 22:06 ftp27

Hi @ftp27 , I am not sure if we could do that but @wess what are your thoughts?

joeyouss avatar Jul 03 '23 14:07 joeyouss