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-9828] JSONEncoder keyEncodingStrategy does not work on Linux #3547

Closed
swift-ci opened this issue Jan 31, 2019 · 3 comments
Closed

[SR-9828] JSONEncoder keyEncodingStrategy does not work on Linux #3547

swift-ci opened this issue Jan 31, 2019 · 3 comments

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-9828
Radar None
Original Reporter Ybrin (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

Docker (swift:4.2.1)

Additional Detail from JIRA
Votes 0
Component/s Foundation, Standard Library
Labels Bug
Assignee @spevans
Priority Medium

md5: c69edd87f0b7da0c9efa933434e66bce

Issue Description:

The following code generates different output on macOS and Linux. I am using Swift 4.2.1

import Foundation
struct JsonShit: Codable {
    let whatTheFuck: String
}
let shit = JsonShit(whatTheFuck: "???")
let encoder = JSONEncoder()
encoder.keyEncodingStrategy = .convertToSnakeCase
try print(String(data: encoder.encode(shit), encoding: .utf8))

The output generated on macOS:

"Optional("{"what_the_fuck":"???"}")"

The output generated on Linux:

"Optional("{"whatTheFuck":"???"}")"

@belkadan
Copy link

belkadan commented Feb 1, 2019

cc @millenomi

@spevans
Copy link
Collaborator

spevans commented Feb 1, 2019

#1875

@spevans
Copy link
Collaborator

spevans commented Feb 20, 2019

Fixed merged into swift-5.0-branch

@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

3 participants