You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current Swift Standard Library implementations of JSONDecoder and PropertyListDecoder do not properly propagate `codingPath` for nested containers.
The attached playground shows the asymmetry between encoders and decoders (I created the playground to ensure that nested containers should have access to the full encoding path: encoders seem to, decoders don't – one or other should be true for both – I wanted to make sure it was not my misunderstanding.)
as a reference, the root cause of the problem can be found at lines: 1247, 1265, 1587, 1613; if nested containers use the decoder's codingPath and not their own to create children, well, the path will not be passed on.
Looking at the tests it seems there were not tests to examine decoder paths.
The text was updated successfully, but these errors were encountered:
Attachment: Download
Additional Detail from JIRA
md5: 122fc73699f6bf537d03028c69343aa7
Issue Description:
The current Swift Standard Library implementations of
JSONDecoder
andPropertyListDecoder
do not properly propagate `codingPath` for nested containers.The attached playground shows the asymmetry between encoders and decoders (I created the playground to ensure that nested containers should have access to the full encoding path: encoders seem to, decoders don't – one or other should be true for both – I wanted to make sure it was not my misunderstanding.)
Using https://github.com/apple/swift/blob/master/stdlib/public/SDK/Foundation/JSONEncoder.swift
as a reference, the root cause of the problem can be found at lines: 1247, 1265, 1587, 1613; if nested containers use the decoder's codingPath and not their own to create children, well, the path will not be passed on.
Looking at the tests it seems there were not tests to examine decoder paths.
The text was updated successfully, but these errors were encountered: