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

[stdlib] Improve error messages when snake case conversion is used. #24904

Merged
merged 1 commit into from
Jun 14, 2019
Merged

[stdlib] Improve error messages when snake case conversion is used. #24904

merged 1 commit into from
Jun 14, 2019

Conversation

GeorgeLyon
Copy link

convertFromSnakeCase and convertToSnakeCase are not inverses of each other for keys like "pictureURL" (which roundtrips to "pictureUrl").
This does not fix the underlying issue, but improves the error message if this situation is detected.

Discussions of the underlying issue, which this PR does not address:
https://forums.swift.org/t/handling-edge-cases-in-jsonencoder-jsondecoder-key-conversion-strategies-sr-6629/12384
#14039

`convertFromSnakeCase` and `convertToSnakeCase` are not inverses of each other for keys like "pictureURL" (which roundtrips to "pictureUrl").
This does not fix the underlying issue, but improves the error message if this situation is detected.
@theblixguy
Copy link
Collaborator

cc @itaiferber

@itaiferber itaiferber requested a review from parkera May 21, 2019 16:22
@itaiferber
Copy link
Contributor

This looks reasonable to me — added @parkera for any input or comments.

@itaiferber
Copy link
Contributor

@swift-ci Please smoke test

@theblixguy
Copy link
Collaborator

Could we merge this?

@itaiferber
Copy link
Contributor

@swift-ci Smoke test and merge

@swift-ci swift-ci merged commit 48e3407 into swiftlang:master Jun 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants