Replace value intrinsic with empty string key#149
Merged
MaxDesiatov merged 3 commits intoCoreOffice:masterfrom Nov 11, 2019
Merged
Replace value intrinsic with empty string key#149MaxDesiatov merged 3 commits intoCoreOffice:masterfrom
MaxDesiatov merged 3 commits intoCoreOffice:masterfrom
Conversation
Collaborator
Author
|
If this change goes through, and anyone, like us, find that a bunch of explicit |
MaxDesiatov
approved these changes
Nov 11, 2019
Collaborator
|
@bwetherfield thanks for the PR! |
arjungupta0107
pushed a commit
to salido/XMLCoder
that referenced
this pull request
Jun 26, 2020
## Overview Restricts the special case usage of `"value"` OR `""` as a coding key, as implemented in CoreOffice#73 to just `""`. `"value"` resumes functioning as a normal coding key. ## Example As noted in CoreOffice#145, `"value"` is starting to collide awkwardly in one or two cases where it may be _implicit_ per the special case usage ```swift <value-containing>I am implicitly labeled</value-containing> ``` or _explicit_, as in ```swift <value-containing> <value>I am explicitly labeled</value> </value-containing> ``` With the change proposed, the latter example will be unambiguously captured by ```swift struct ValueContaining: Codable { let value: String } ``` while the former is equivalent to ```swift struct ValueContaining: Codable { let value: String enum CodingKeys: String, CodingKey { case value = "" } } ``` ## Source Compatability This is a **breaking change** for downstream users of the special `"value"` coding key. All such uses should be replaced by `case value = ""` subject to this PR's inclusion.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Restricts the special case usage of
"value"OR""as a coding key, as implemented in #73 to just""."value"resumes functioning as a normal coding key.Example
As noted in #145,
"value"is starting to collide awkwardly in one or two cases where it may be implicit per the special case usageor explicit, as in
With the change proposed, the latter example will be unambiguously captured by
while the former is equivalent to
Source Compatability
This is a breaking change for downstream users of the special
"value"coding key. All such uses should be replaced bycase value = ""subject to this PR's inclusion.