To add to the existing answers, for some in-depth information on synthesis, please see How does automatic Codable compliance work? For the sake of extending it - #3 by itaiferber (with some additional info in Inheriting from a Codable class) [among some of my other past posts]. There are also direct links to the implementation that you can skim through, if you're comfortable with C++.