General question: is there a particular reason this isn't using `Encodable` and the `json` encoder?