I have a open-source Swift package that interfaces with a RESTful JSON API. One of the features of this SDK is that if your model classes conform to a specific protocol and follow the proper formatting, you can deserialize your own types from this JSON API (the mechanism is an extension of Swift.Decodable
.
Anyway, I'm investigating auto-generating the source code for API clients so users can save themselves the time of writing files on their own and I came across Sourcery. I also tried SwiftSyntax, but it really doesn't seem stable yet and the documentation was very sparse.
Anyway, I'd like to use Swift templates instead of Stencil templates so that I can make the proper networking calls to infer the client's model and then dynamically create the templates in Swift—the API & SDK enable introspecting the model to grab the relevant type info and property names.
Is this something you (all) would recommend doing with Sourcery? If so, is there a place where I can find documentation on Swift templates?
Thanks