https://github.com/jeshan/swagger-codegen-cli
Swagger codegen cli. Small docker image suitable for CI
https://github.com/jeshan/swagger-codegen-cli
docker-image swagger swagger-codegen
Last synced: 9 days ago
JSON representation
Swagger codegen cli. Small docker image suitable for CI
- Host: GitHub
- URL: https://github.com/jeshan/swagger-codegen-cli
- Owner: jeshan
- Created: 2017-10-07T11:45:21.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-07T13:43:24.000Z (over 8 years ago)
- Last Synced: 2026-04-04T06:42:26.583Z (2 months ago)
- Topics: docker-image, swagger, swagger-codegen
- Size: 1.95 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# swagger-codegen-cli
The official image doesn't allow calling easily in a CI environment like Gitlab CI. This image is to allow that.
# Examples
## Docker Compose
Run:
`docker-compose up`
This will look for a file called swagger.yaml in the current directory, compile a java client and output it into a directory called swagger-java-client. But chances are you want to customise this. Use the following options:
- SRC_PATH=/path/to/your/project
- SPEC_RELATIVE_PATH=$RELATIVE_TO_SRC_PATH/swagger.yaml
- SWAGGER_LANG=java
Either modify them in .env or run them as follows:
`SRC_PATH=/path/to/your/project SPEC_RELATIVE_PATH=$RELATIVE_TO_SRC_PATH/swagger.yaml SWAGGER_LANG=java docker-compose up`
## Gitlab CI
```yaml
swagger:
image: jeshan/swagger-codegen-cli
stage: build
script:
- 'java -jar /swagger-codegen-cli.jar generate -l java -i server/api/swagger/swagger.yaml -o swagger-java-client'
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
paths: ['swagger-java-client']
```