You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like SwiftyJSON is simply returning the stringValue from NSNumber here, and that property obviously doesn't know anything about JSON syntax.
For comparison, when Foundation.JSONSerialization sees a Double.nan, it throws an NSInvalidArgumentException, "Invalid number value (NaN) in JSON write".
What did you do?
JSON(Double.nan).rawString()
What did you expect to happen?
There's no way to serialize NaN (or Inf) in JSON, and
rawString()
returns an optional, so I expected to get nil.What actually happened instead?
I got the Swift string
"nan"
(which is not valid JSON).Environment
List the software versions you're using:
Please also mention which package manager you used and its version.
other package managers in this list:
Project that demonstrates the issue
(It's literally one line of code, and it's shown above in full. If you really need a complete project, let me know and I'll see what I can do.)
The text was updated successfully, but these errors were encountered: