File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Darwin/Foundation-swiftoverlay Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -1376,10 +1376,13 @@ fileprivate struct _JSONKeyedDecodingContainer<K : CodingKey> : KeyedDecodingCon
1376
1376
// In this case we can attempt to recover the original value by reversing the transform
1377
1377
let original = key. stringValue
1378
1378
let converted = JSONEncoder . KeyEncodingStrategy. _convertToSnakeCase ( original)
1379
+ let roundtrip = JSONDecoder . KeyDecodingStrategy. _convertFromSnakeCase ( converted)
1379
1380
if converted == original {
1380
1381
return " \( key) ( \" \( original) \" ) "
1381
- } else {
1382
+ } else if roundtrip == original {
1382
1383
return " \( key) ( \" \( original) \" ), converted to \( converted) "
1384
+ } else {
1385
+ return " \( key) ( \" \( original) \" ), with divergent representation \( roundtrip) , converted to \( converted) "
1383
1386
}
1384
1387
default :
1385
1388
// Otherwise, just report the converted string
You can’t perform that action at this time.
0 commit comments