diff --git a/.gitignore b/.gitignore index d84a08f7b94..e42dfdcb021 100644 --- a/.gitignore +++ b/.gitignore @@ -48,6 +48,7 @@ atlassian-ide-plugin.xml packages/ .pub .packages +.vagrant/ samples/client/petstore/php/SwaggerClient-php/composer.lock samples/client/petstore/php/SwaggerClient-php/vendor/ @@ -59,6 +60,13 @@ samples/client/petstore/perl/deep_module_test/ samples/client/petstore/python/.projectile samples/client/petstore/python/.venv/ +samples/client/petstore/python/dev-requirements.txt.log + +samples/client/petstore/objc/SwaggerClientTests/SwaggerClient.xcodeproj/xcuserdata +samples/client/petstore/swift/SwaggerClientTests/SwaggerClient.xcodeproj/xcuserdata +samples/client/petstore/swift/SwaggerClientTests/SwaggerClient.xcworkspace/xcuserdata +samples/client/petstore/swift/SwaggerClientTests/Pods/Pods.xcodeproj/xcuserdata +samples/client/petstore/swift/SwaggerClientTests/Pods/Pods.xcodeproj/xcshareddata/xcschemes .settings @@ -67,3 +75,11 @@ samples/client/petstore/python/.venv/ *.pm~ *.xml~ *.t~ + +samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/ +samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/ +**/.gradle/ + +samples/client/petstore/python/dev-requirements.txt.log +samples/client/petstore/python/swagger_client.egg-info/SOURCES.txt +samples/client/petstore/python/.coverage diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f80eeb3cd01..35294347b00 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,7 @@ ## Before submitting an issue - - Before submitting an issue, search the [open issue](https://github.com/swagger-api/swagger-codegen/issues) and [closed issue](https://github.com/swagger-api/swagger-codegen/issues?q=is%3Aissue+is%3Aclosed) to ensure no one else has reported something similar before. + - Search the [open issue](https://github.com/swagger-api/swagger-codegen/issues) and [closed issue](https://github.com/swagger-api/swagger-codegen/issues?q=is%3Aissue+is%3Aclosed) to ensure no one else has reported something similar before. - The issue should contain details on how to repeat the issue, e.g. - the OpenAPI Spec for reproducing the issue (:bulb: use [Gist](https://gist.github.com) to share). If the OpenAPI Spec cannot be shared publicly, it will be hard for the community to help - version of Swagger Codegen @@ -31,10 +31,12 @@ For a list of variables available in the template, please refer to this [page](h Code change should conform to the programming style guide of the respective langauages: - C#: https://msdn.microsoft.com/en-us/library/vstudio/ff926074.aspx - Java: https://google.github.io/styleguide/javaguide.html +- JavaScript - https://github.com/airbnb/javascript/tree/master/es5 - ObjC: https://github.com/NYTimes/objective-c-style-guide - PHP: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md - Python: https://www.python.org/dev/peps/pep-0008/ - Ruby: https://github.com/bbatsov/ruby-style-guide +- Swift: https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/TheBasics.html - TypeScript: https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines diff --git a/README.md b/README.md index f5ba049c8d4..5ba583bf677 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,13 @@ # Swagger Code Generator -[![Build Status](https://travis-ci.org/swagger-api/swagger-codegen.png)](https://travis-ci.org/swagger-api/swagger-codegen) +[![Build Status](https://travis-ci.org/swagger-api/swagger-codegen.svg)](https://travis-ci.org/swagger-api/swagger-codegen) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.swagger/swagger-codegen-project/badge.svg?style=plastic)](https://maven-badges.herokuapp.com/maven-central/io.swagger/swagger-codegen-project) +[![PR Stats](http://issuestats.com/github/swagger-api/swagger-codegen/badge/pr)](http://issuestats.com/github/swagger-api/swagger-codegen) [![Issue Stats](http://issuestats.com/github/swagger-api/swagger-codegen/badge/issue)](http://issuestats.com/github/swagger-api/swagger-codegen) :star::star::star: If you would like to contribute, please refer to [guidelines](https://github.com/swagger-api/swagger-codegen/blob/master/CONTRIBUTING.md) and a list of [open tasks](https://github.com/swagger-api/swagger-codegen/issues?q=is%3Aopen+is%3Aissue+label%3A%22Need+community+contribution%22).:star::star::star: ## Overview -This is the swagger codegen project, which allows generation of client libraries automatically from a Swagger-compliant server. +This is the swagger codegen project, which allows generation of client libraries automatically from a Swagger-compliant server. Check out [Swagger-Spec](https://github.com/OAI/OpenAPI-Specification) for additional information about the Swagger project, including additional libraries with support for other languages and more. @@ -22,7 +23,7 @@ Check out [Swagger-Spec](https://github.com/OAI/OpenAPI-Specification) for addit - [Building](#building) - [Docker](#docker) - [Build and run](#build-and-run-using-docker) - - [Build a Node.js server stub](#build-a-nodejs-server-stub) + - [Run docker in Vagrant](#run-docker-in-vagrant) - [Public Docker image](#public-docker-image) - [Homebrew](#homebrew) - Generators @@ -33,21 +34,26 @@ Check out [Swagger-Spec](https://github.com/OAI/OpenAPI-Specification) for addit - [Where is Javascript???](#where-is-javascript) - [Generating a client from local files](#generating-a-client-from-local-files) - [Customizing the generator](#customizing-the-generator) - - [Validating your OpenAPI Spec](#validating-your-swagger-spec) + - [Validating your OpenAPI Spec](#validating-your-openapi-spec) - [Generating dynamic html api documentation](#generating-dynamic-html-api-documentation) - [Generating static html api documentation](#generating-static-html-api-documentation) - [To build a server stub](#to-build-a-server-stub) - [Node.js](#nodejs) + - [PHP Slim](#php-slim) - [PHP Silex](#php-silex) - [Python Flask (Connexion)](#python-flask-connexion) - [Ruby Sinatra](#ruby-sinatra) - [Scala Scalatra](#scala-scalatra) - - [Java JAX-RS](#java-jax-rs) + - [Java JAX-RS (Java JAX-RS (Jersey v1.18)](#java-jax-rs-jersey-v118) + - [Java JAX-RS (Apache CXF 2 / 3)](#java-jax-rs-apache-cxf-2--3) - [Java Spring MVC](#java-spring-mvc) + - [Haskell Servant](#haskell-servant) + - [ASP.NET 5 Web API](#aspnet-5-web-api) - [To build the codegen library](#to-build-the-codegen-library) - [Workflow Integration](#workflow-integration) - [Online Generators](#online-generators) - [Guidelines for Contribution](https://github.com/swagger-api/swagger-codegen/wiki/Guidelines-for-Contribution) + - [Companies/Projects using Swagger Codegen](#companiesprojects-using-swagger-codegen) - [License](#license) @@ -63,10 +69,10 @@ Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes ### Prerequisites -If you're looking for the latest stable version, you can grab it directly from maven central (you'll need the java 7 runtime): +If you're looking for the latest stable version, you can grab it directly from maven central (you'll need java 7 runtime at a minimum): ``` -wget http://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.1.4/swagger-codegen-cli-2.1.4.jar swagger-codegen-cli.jar +wget http://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.1.5/swagger-codegen-cli-2.1.5.jar -O swagger-codegen-cli.jar java -jar swagger-codegen-cli.jar help ``` @@ -103,19 +109,21 @@ mvn package ``` git clone https://github.com/swagger-api/swagger-codegen - cd swagger-codegen - ./run-in-docker.sh mvn package ``` -#### Build a Node.js server stub + +#### Run Docker in Vagrant +Prerequisite: install [Vagrant](https://www.vagrantup.com/downloads.html) and [VirtualBox](https://www.virtualbox.org/wiki/Downloads). ``` -./run-in-docker.sh generate \ - -i http://petstore.swagger.io/v2/swagger.json \ - -l nodejs \ - -o samples/server/petstore/nodejs +git clone http://github.com/swagger-api/swagger-codegen.git +cd swagger-codegen +vagrant up +vagrant ssh +cd /vagrant +./run-in-docker.sh mvn package ``` #### Public Docker image @@ -153,18 +161,27 @@ with a number of options. You can get the options with the `help generate` comm ``` NAME - swagger generate - Generate code with chosen lang + swagger-codegen-cli generate - Generate code with chosen lang SYNOPSIS - swagger generate [(-a | --auth )] + swagger-codegen-cli generate + [(-a | --auth )] + [--additional-properties ] + [--api-package ] [--artifact-id ] + [--artifact-version ] [(-c | --config )] - [-D ] + [-D ] [--group-id ] (-i | --input-spec ) + [--import-mappings ] + [--instantiation-types ] + [--invoker-package ] (-l | --lang ) + [--language-specific-primitives ] + [--library ] [--model-package ] [(-o | --output )] - [(-t