-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial golang and typescript SDK and templates #271
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few questions here:
- How will we keep the SDK up to date?
- Is the generated code deterministic?
- Can we add a target for testing the TS/JS SDK (or is that already covered?)
- Can we add a step to our GH action to invoke the code generator + run tests?
Code gen does a lot of the heavy lifting, but the wrapper requires manual work. But that really took me a couple hours and once boilerplate there was easier as it went along.
Because we download the templates it is very deterministic.
What do you mean by target? Like code coverage? Right now the code coverage is low (like 33% last I checked) because the code generated models are very detailed but I think the prime scenarios are well covered.
We can certainly run tests. I would prefer, at least initially, that we choose when we run the generator as it really only matters when we update the swagger.yaml doc, but even then would want the dev to run it and include it in the PR. |
👍
👍
A target in the
This is contrary to our historical approach to code generation. In the past we've run codegen with each PR and then checked for a dirty working tree in order to ensure that our generated code is out-of-date. I have a slight preference for this style, as it makes it easier to ensure that the swagger definition doesn't drift from the generated SDK. |
This is a large PR with lots of generated files, so here is a walkthrough. Basically each language SDK has templates, those templates are used to generate a "raw" API, and there is a handcrafted but light wrapper to "cleanup" the result or provide convenience methods.