swagger-codegen

(β˜… 17,779)

swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.

Showing a partial file list β€” download the zip above to see everything.

  • .dockerignore
  • .gitignore
  • .whitesource
  • appveyor.yml
  • CODE_OF_CONDUCT.md
  • CONTRIBUTING.md
  • docker-entrypoint.sh
  • Dockerfile
  • eclipse-formatter.xml
  • google_checkstyle.xml
  • LICENSE
  • README.md
  • Vagrantfile

πŸš€ Installation Guide

1. Get the code
git clone https://github.com/swagger-api/swagger-codegen

Downloads the entire project code from GitHub to your computer.

cd swagger-codegen

Moves into the project folder you just downloaded.

2. Docker

Easy Recommended
Prerequisites
  • Git Needed to download the project code from GitHub.
  • Docker Desktop Needed to build and run containers. Install it and keep it running in the background.
docker build -t swagger-codegen .

Builds a runnable image based on the Dockerfile.

docker run -p 8080:80 swagger-codegen

Runs the built image as an actual container.

βœ… Run docker compose ps to check the containers are Up. If the README mentions a port, open http://localhost:PORT in your browser.

3. Maven (Java)

Medium
Prerequisites
  • Git Needed to download the project code from GitHub.
  • JDK (Java) Required to build and run Java projects.
  • Maven The build tool used for the mvn command.
mvn clean package

Installs dependencies and builds the project using Maven.

mvn package

Installs dependencies and builds the project using Maven.

βœ… A BUILD SUCCESS message means it worked. The output is created under target/.

Pulled directly from this repo's README.

4. PHP (Composer)

Easy
Prerequisites
  • Git Needed to download the project code from GitHub.
  • PHP A PHP runtime is required.
  • Composer The package manager used to install PHP libraries.
cd modules/swagger-codegen/src/main/resources/php-silex

This project's files live in a subfolder, so move into it first.

composer install

Installs the PHP libraries listed in composer.json.

βœ… Run it with a built-in server like php -S localhost:8000, then open http://localhost:8000 in your browser.

5. Ruby

Easy
Prerequisites
  • Git Needed to download the project code from GitHub.
  • Ruby Ruby is required to use the bundle command.
cd modules/swagger-codegen/src/main/resources/rails5

This project's files live in a subfolder, so move into it first.

bundle install

Installs the Ruby libraries listed in the Gemfile.

βœ… If bundle install finishes without errors, continue with the run command from the README (e.g. rails server).
// repository documentation