OpenAPI generator
wilsonianb opened this issue · comments
Should a single tool be used to generate all of the SDK and client libraries from the OpenAPI schema?
It looks like the python client was generated using @openapitools/openapi-generator-cli
The OpenAPI Generator is a Java project. openapi-generator-cli will download the appropriate JAR file and invoke the java executable to run the OpenAPI Generator. You must have the java binary executable available on your PATH for this to work.
I'm not crazy about needing Java. Would it be ok to instead require devs to have docker (just for client generation)?
https://www.npmjs.com/package/@openapitools/openapi-generator-cli#use-docker-instead-of-running-java-locally
There's also:
- openapi-type-codegen ("we do not want to use JAVA codegen in our builds"😅), but then we're using different tooling for the python and js clients...
- https://github.com/microsoft/kiota
I'm also wondering if there should be a single script (in the root package.json?) to regenerate all clients and sdks based on the current OpenAPI specs.
You could then have husky and/or a GitHub Actions workflow validate that everything's up to date.
- Originally posted by @wilsonianb in #43 (comment)
After an office hours discussion with @jzanecook, I'm planning on:
- adding a script to generate Python and TypeScript clients using @openapitools/openapi-generator-cli (docker mode, no java)
- adding a GitHub Actions workflow to run this script and validate that it doesn't create a diff (to confirm that OpenAPI schema changes are accompanied by updated clients)
- adding a GitHub Actions workflow to validate the current OpenAPI schemas #94