Once you have your REST API documented in Swagger/OpenAPI spec, you can easily utilize tools like curl
or other http tools to trigger an HTTP request and generate API clients during your build process. For instance, here is a curl command example for creating a ruby client from the
http://petstore.swagger.io/v2/swagger.json
:
curl -X POST -H "content-type:application/json" -d '{"swaggerUrl":"http://petstore.swagger.io/v2/swagger.json"}' https://generator.swagger.io/api/gen/clients/ruby
For more details, you can visit https://github.com/swagger-api/swagger-codegen#online-generators.
UPDATE: As of May 2018, a group of around 50 major contributors and template creators of Swagger Codegen decided to create a community-based version called OpenAPI Generator. Check out the Q&A for more information.