Skip to content
New issue

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

[SR-9503] JSONSerialization difference behaviour for null values in Linux vs macOS #3572

Closed
swift-ci opened this issue Dec 13, 2018 · 2 comments

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-9503
Radar None
Original Reporter alirp88 (JIRA User)
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug
Assignee ogres (JIRA)
Priority Medium

md5: ef1cceef78d42f264f2afcdf659f2553

Issue Description:

Hi

The following code on macOS and Linux (I used docker image swift:4.2 for my test) behave differently

import Foundation

let sampleString = "{\"sampleField\":null}"

print(try JSONSerialization.jsonObject(with: sampleString.data(using: .utf8)!, options: []))

On macOS it prints

{
    sampleField = "<null>";
}

and on Linux it prints

["sampleField": <NSNull: 0x00000000075ce1c0>]
@belkadan
Copy link

I think those represent the same object, just printing differently.

@swift-ci
Copy link
Contributor Author

Comment by Sergo Beruashvili (JIRA)

#1809

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants