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
{{ message }}
Repository navigation
Error decoding nested JSON with missing container #40
Since my struct has an optional type for the url property, I would expect it to ignore the missing container and fallback to setting the value as nil. Instead, I get back an error:
typeMismatch(Swift.Dictionary<Swift.String, Any>, Swift.DecodingError.Context(codingPath: [], debugDescription: "Expected to decode Dictionary<String, Any> but found a null value instead.", underlyingError: nil))
I tried setting a default value using @Default(nil as URL?) but that didn't seem to work.
Activity
soumyamahunt commentedon Nov 8, 2023
Thanks, this is a good find!
Currently
MetaCodableonly uses fallback only if the last key decoding fails. This is a bug and the fix is going to be a bit tricky.