We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
md5: 8df5f3d2bd14addf4919e5266cb9f0cd
duplicates:
Issue Description:
The check in isValidJSONObject on Linux only checks for generic-width ints (Int, UInt) and not explicit sized widths (e.g. Int8)
// object is Swift.String, NSNull, Int, Bool, or UInt if obj is String || obj is NSNull || obj is Int || obj is Bool || obj is UInt { return true }
As a result, this code behaves differently on Linux and Darwin:
import Foundation let i64:Int64 = 1 let i:Int = 1 print( [JSONSerialization.isValidJSONObject(["int64":i64]), JSONSerialization.isValidJSONObject(["int":i])])
On Darwin, this prints
[true, true]
On Linux, this prints
[false, true]
Adding explicitly sized integer widths (Int64, Int8 etc.) into the isValidObject should fix the problem.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Additional Detail from JIRA
md5: 8df5f3d2bd14addf4919e5266cb9f0cd
duplicates:
Issue Description:
The check in isValidJSONObject on Linux only checks for generic-width ints (Int, UInt) and not explicit sized widths (e.g. Int8)
As a result, this code behaves differently on Linux and Darwin:
On Darwin, this prints
[true, true]
On Linux, this prints
[false, true]
Adding explicitly sized integer widths (Int64, Int8 etc.) into the isValidObject should fix the problem.
The text was updated successfully, but these errors were encountered: