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?
to your account
Xcode 10.2.1 (10E1001)
Apple Swift version 5.0.1 (swiftlang-1001.0.82.4 clang-1001.0.46.5)
JSONDecoder has regressed between Swift 4.2.4 and Swift 5.0.
Encoding the value ["camelCase": 1] with .convertToSnakeCase would convert the key in Swift 4, but no longer does so in Swift 5.
I can't find anything in the release notes suggesting that this is an expected outcome.
A Swift file showing the issue is attached.
➤ ./swift-4.2.4-RELEASE.xctoolchain/usr/bin/swift ~/test.swift
➤ ./swift-5.0-RELEASE.xctoolchain/usr/bin/swift ~/test.swift
The text was updated successfully, but these errors were encountered:
cc bendjones (JIRA User), @millenomi
Sorry, something went wrong.
Comment by Ben D. Jones (JIRA)
Thanks @belkadan I'll take a look.
This was a purposeful fix for SR-7360 made in PR-16238
Comment by Danni Stjernegård (JIRA)
I see that the old behavior was deemed a bug after a long discussion on the forums. Up until then multiple people, including @belkadan and @itaiferber called it correct and expected behavior.
I've spent the entire day fire fighting after this slipped through our testing and am not sure how we should have noticed the change without combing through the forums.
It was never mentioned in the changelog and I'm seeing that the corelibs-foundation team didn't notice either until just 13 days ago.
Changes like this, that not only breaks existing code, but does so in a way that's not possible to detect by the compiler, would be very appreciated if given a mention a bit more noticeably.
Even searching Google for information, I'm finding nothing except for the forum thread where the change was agreed on. Nothing on the official documentation either.
No branches or pull requests