class A: Codable { var x: String? }
class B: A { var y: String? }
When I try to decode class B, the property "y" remains nil even though there is a value for it in the JSON data. If I change it to B: Codable then it works.
When I try to search for a solution, all I can find is people overriding init methods and doing decoding manually in some way. I am having a hard time believeing that this is the right answer.
Surely, coding works across class hierarchies?