add guidelines for contriubtion

This commit is contained in:
wing328
2015-11-04 22:32:06 +08:00
parent 76cee8bc6b
commit 449fa3a0f5

View File

@@ -14,12 +14,13 @@ Check out [Swagger-Spec](https://github.com/swagger-api/swagger-spec) for additi
- [Overview](#overview)
- [Table of Contents](#table-of-contents)
- Installation
- [Build and run using docker](#build-and-run-using-docker)
- [Build a nodejs server stub](#build-a-nodejs-server-stub)
- [Compatibility](#compatibility)
- [Prerequisites](#prerequisites)
- [OS X Users](#os-x-users)
- [Building](#building)
- [OS X Users](#os-x-users)
- [Building](#building)
- [Docker](#docker)
- [Build and run](#build-and-run-using-docker)
- [Build a Node.js server stub](#build-a-nodejs-server-stub)
- Generators
- [To generate a sample client library](#to-generate-a-sample-client-library)
- [Generating libraries from your server](#generating-libraries-from-your-server)
@@ -40,26 +41,9 @@ Check out [Swagger-Spec](https://github.com/swagger-api/swagger-spec) for additi
- [Java Spring MVC](#java-spring-mvc)
- [To build the codegen library](#to-build-the-codegen-library)
- [Online Generators](#online-generators)
- [Guidelines for Contribution](https://github.com/swagger-api/swagger-codegen/wiki/Guidelines-for-Contribution)
- [License](#license)
## Build and run using docker
```
git clone https://github.com/swagger-api/swagger-codegen
cd swagger-codegen
./run-in-docker.sh mvn package
```
## Build a nodejs server stub
```
./run-in-docker.sh generate \
-i http://petstore.swagger.io/v2/swagger.json \
-l nodejs \
-o samples/server/petstore/nodejs
```
## Compatibility
The Swagger Specification has undergone 3 revisions since initial creation in 2010. The swagger-codegen project has the following compatibilies with the swagger specification:
@@ -88,14 +72,33 @@ export JAVA_HOME=`/usr/libexec/java_home -v 1.7`
export PATH=${JAVA_HOME}/bin:$PATH
```
#### Building
### Building
After cloning the project, you can build it from source with this command:
```
mvn package
```
### Docker
#### Build and run using docker
```
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-in-docker.sh generate \
-i http://petstore.swagger.io/v2/swagger.json \
-l nodejs \
-o samples/server/petstore/nodejs
```
### To generate a sample client library
You can build a client against the swagger sample [petstore](http://petstore.swagger.io) API as follows:
@@ -481,6 +484,11 @@ curl -X POST -H "content-type:application/json" -d '{"swaggerUrl":"http://petsto
```
Then you will receieve a JSON response with the URL to download the zipped code.
Guidelines for Contribution
---------------------------
Please refer to this [page](https://github.com/swagger-api/swagger-codegen/wiki/Guidelines-for-Contribution)
License
-------