Skip to content

Commit 72feda8

Browse files
committed
updated readme
1 parent 2e88dea commit 72feda8

File tree

1 file changed

+28
-16
lines changed

1 file changed

+28
-16
lines changed

README.md

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@ The goal of Swagger™ is to define a standard, language-agnostic interface to R
1313
Check out [Swagger-Spec](https://github.com/swagger-api/swagger-spec) for additional information about the Swagger project, including additional libraries with support for other languages and more.
1414

1515

16-
1716
## Compatability
1817
The Swagger Specification has undergone 3 revisions since initial creation in 2010. The swagger-codegen project has the following compatibilies with the swagger specification:
1918

2019
Swagger Codegen Version | Release Date | Swagger Spec compatability | Notes
2120
----------------------- | ------------ | -------------------------- | -----
22-
2.1.0 (in development) | n/a | 1.0, 1.1, 1.2, 2.0 | [branch develop_2.0](https://github.com/swagger-api/swagger-codegen/tree/develop_2.0)
21+
2.1.0-M1 | 2015-02-16 | 1.0, 1.1, 1.2, 2.0 | [tag v2.1.0-M1](https://github.com/swagger-api/swagger-codegen/tree/v2.1.0-M1)
2322
2.0.17 | 2014-08-22 | 1.1, 1.2 | [tag v2.0.17](https://github.com/swagger-api/swagger-codegen/tree/v2.0.17)
2423
1.0.4 | 2012-04-12 | 1.0, 1.1 | [tag v1.0.4](https://github.com/swagger-api/swagger-codegen/tree/swagger-codegen_2.9.1-1.1)
2524

@@ -47,7 +46,7 @@ You can build a client against Wordnik's [petstore](http://petstore.swagger.io)
4746
This will run the generator with this command:
4847

4948
```
50-
java -cp ./target/*:./target/lib/* com.wordnik.swagger.codegen.Codegen \
49+
java -jar modules/swagger-codegen-distribution/target/swagger-codegen-distribution-2.1.0-M1.jar \
5150
-i http://petstore.swagger.io/v2/swagger.json \
5251
-l java \
5352
-o samples/client/petstore/java
@@ -56,8 +55,18 @@ java -cp ./target/*:./target/lib/* com.wordnik.swagger.codegen.Codegen \
5655
With a number of options. You can get the options with the -h flag:
5756
```
5857
usage: Codegen
58+
-a,--auth addes authorization headers when fetching the
59+
swagger definitions remotely. Pass in a
60+
URL-encoded string of name:header with a comma
61+
separating multiple values
62+
-d,--debug-info prints additional info for debugging
63+
-h,--help shows this message
5964
-i,--input-spec <arg> location of the swagger spec, as URL or file
60-
-l,--lang <arg> client language to generate
65+
-l,--lang <arg> client language to generate.
66+
Available languages include:
67+
[android, java, jaxrs, nodejs, objc, scalatra,
68+
scala, dynamic-html, html, swagger, tizen, php,
69+
python]
6170
-o,--output <arg> where to write the generated files
6271
-t,--template-dir <arg> folder containing the template files
6372
```
@@ -95,12 +104,7 @@ If you don't want to call your server, you can save the swagger spec files into
95104
to the code generator like this:
96105

97106
```
98-
-i ./src/test/resources/petstore.json
99-
```
100-
101-
Or for example:
102-
```
103-
./bin/java-petstore-filemap.sh
107+
-i ./modules/swagger-codegen/src/test/resources/2_0/petstore.json
104108
```
105109

106110
Great for creating libraries on your ci server, from the [Swagger Editor](http://editor.swagger.io)... or while coding on an airplane.
@@ -110,12 +114,20 @@ Great for creating libraries on your ci server, from the [Swagger Editor](http:/
110114
There are different aspects of customizing the code generator beyond just creating or modifying templates. Each language has a supporting configuration file to handle different type mappings, etc:
111115

112116
```
113-
$ ls -1 src/main/java/com/wordnik/swagger/codegen/languages/
117+
$ ls -1 modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/
114118
AndroidClientCodegen.java
115119
JavaClientCodegen.java
116120
JaxRSServerCodegen.java
121+
NodeJSServerCodegen.java
117122
ObjcClientCodegen.java
123+
PhpClientCodegen.java
124+
PythonClientCodegen.java
125+
ScalaClientCodegen.java
126+
ScalatraServerCodegen.java
118127
StaticDocCodegen.java
128+
StaticHtmlGenerator.java
129+
SwaggerGenerator.java
130+
TizenClientCodegen.java
119131
```
120132

121133
Each of these files creates reasonable defaults so you can get running quickly. But if you want to configure package names, prefixes, model folders, etc., you may want to extend these.
@@ -153,7 +165,7 @@ http://online.swagger.io/validator/debug?url=http://petstore.swagger.io/v2/swagg
153165
To do so, just use the `-l dynamic-html` flag when reading a spec file. This creates HTML documentation that is available as a single-page application with AJAX. To view the documentation:
154166

155167
```
156-
cd samples/swagger-dynamic-html/
168+
cd samples/dynamic-html/
157169
npm install
158170
node .
159171
```
@@ -166,7 +178,7 @@ Which launches a node.js server so the AJAX calls have a place to go.
166178
To do so, just use the `-l html` flag when reading a spec file. This creates a single, simple HTML file with embedded css so you can ship it as an email attachment, or load it from your filesystem:
167179

168180
```
169-
cd samples/swagger-html/
181+
cd samples/html/
170182
open index.html
171183
```
172184

@@ -177,7 +189,7 @@ You can also use the codegen to generate a server for a couple different framewo
177189

178190
### node.js
179191
```
180-
java -cp ./target/*:./target/lib/* com.wordnik.swagger.codegen.Codegen \
192+
java -jar modules/swagger-codegen-distribution/target/swagger-codegen-distribution-2.1.0-M1.jar \
181193
-i http://petstore.swagger.io/v2/swagger.json \
182194
-l nodejs \
183195
-o samples/server/petstore/nodejs
@@ -189,7 +201,7 @@ java -cp ./target/*:./target/lib/* com.wordnik.swagger.codegen.Codegen \
189201

190202
### scala scalatra
191203
```
192-
java -cp ./target/*:./target/lib/* com.wordnik.swagger.codegen.Codegen \
204+
java -jar modules/swagger-codegen-distribution/target/swagger-codegen-distribution-2.1.0-M1.jar \
193205
-i http://petstore.swagger.io/v2/swagger.json \
194206
-l scalatra \
195207
-o samples/server/petstore/scalatra
@@ -198,7 +210,7 @@ java -cp ./target/*:./target/lib/* com.wordnik.swagger.codegen.Codegen \
198210
### java jax-rs
199211

200212
```
201-
java -cp ./target/*:./target/lib/* com.wordnik.swagger.codegen.Codegen \
213+
java -jar modules/swagger-codegen-distribution/target/swagger-codegen-distribution-2.1.0-M1.jar \
202214
-i http://petstore.swagger.io/v2/swagger.json \
203215
-l jaxrs \
204216
-o samples/server/petstore/jaxrs

0 commit comments

Comments
 (0)