Closed levibostian closed 4 years ago
Not going to do this. I am not using a protocol anymore for VO objects to respect. I am creating a model and a VO separately. It works well because since you must convert from one to the other, that's the oppourtunity to make sure there are not any properties missing.
When using this new concept of how to update existing app DB models with new data, I have a VO codable object that represents the JSON structure of an API network response body, a model that has all properties of JSON structure plus some optional local-only properties, and a protocol that represents all of the properties that the VO and model have in common.
I would love to have sourcery generate the VO and maybe even the model from a protocol for me.
The sourcery template would generate automatically:
I can then use optional annotations for naming the associatedValues. I can also use extensions for the model if I want to add optional local-only properties.