OpenAPI Generator
ActionsTags
(1)This GitHub Action allows you to automatically generate code using the OpenAPI Tools generator. The OpenAPI Tools generator provides a set of powerful features to generate client SDKs, server stubs, documentation, and more from your OpenAPI specification file.
Here's an example workflow that demonstrates how to use this GitHub Action:
name: Generate Code from OpenAPI
on:
release:
types: [published]
jobs:
generate_code:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Generate code
uses: hatamiarash7/openapi-generator@v0.2.0
with:
generator: python
openapi-file: example.yml
# Do anything you want with the generated code
- name: Do anything
run: ...
Name | Type | Default | Description |
---|---|---|---|
generator |
Required | The name of the generator to use e.g. "typescript-angular" | |
generator-tag |
latest |
The Docker tag of the openapitools/openapi-generator-cli image to use |
|
openapi-file |
./openapi.json |
The path to the OpenAPI document | |
openapi-url |
UNSET |
If set, the OpenAPI document will be loaded from this URL instead of openapi-file |
|
config-file |
UNSET |
The path to the config file to be passed along to the generator | |
template-dir |
UNSET |
The path to the folder containing the template files | |
output-dir |
UNSET |
The path to the folder where the generated files will be placed | |
command-args |
Additional arguments to pass through to the generator |
Note: The default output directory is
./{generator}-client
. If you want to change this, you must set theoutput-dir
input. You can also use the/github/workspace
to write your files to the root of your repository.
Don't be shy and reach out to us if you want to contribute.
- Fork it !
- Create your feature branch :
git checkout -b my-new-feature
- Commit your changes :
git commit -am 'Add some feature'
- Push to the branch :
git push origin my-new-feature
- Submit a pull request
Each project may have many problems. Contributing to the better development of this project by reporting them.
OpenAPI Generator is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.