You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+68-27Lines changed: 68 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,12 +13,12 @@ The goal of Swagger™ is to define a standard, language-agnostic interface to R
13
13
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.
14
14
15
15
16
-
## Compatibility
17
-
The Swagger Specification has undergone 3 revisions since initial creation in 2010. The swagger-codegen project has the following compatibilities with the swagger specification:
16
+
## Compatability
17
+
The Swagger Specification has undergone 3 revisions since initial creation in 2010. The swagger-codegen project has the following compatibilies with the swagger specification:
18
18
19
-
Swagger Codegen Version | Release Date | Swagger Spec compatability | Notes
19
+
Swagger Codegen Version | Release Date | Swagger Spec compatibility | Notes
You can then compile and run the client, as well as unit tests against it:
@@ -91,7 +109,17 @@ It's just as easy--just use the `-i` flag to point to either a server or file.
91
109
### Modifying the client library format
92
110
Don't like the default swagger client syntax? Want a different language supported? No problem! Swagger codegen processes mustache templates with the [jmustache](https://github.com/samskivert/jmustache) engine. You can modify our templates or make your own.
93
111
94
-
You can look at `modules/swagger-codegen/src/main/resources/${your-language}` for examples. To make your own templates, create your own files and use the `-t` flag to specify your tempalte folder. It actually is that easy.
112
+
You can look at `modules/swagger-codegen/src/main/resources/${your-language}` for examples. To make your own templates, create your own files and use the `-t` flag to specify your template folder. It actually is that easy.
113
+
114
+
### Making your own codegen modules
115
+
If you're starting a project with a new language and don't see what you need, swagger-codegen can help you create a project to generate your own libraries:
116
+
117
+
```
118
+
java -jar modules/swagger-codegen-distribution/target/swagger-codegen-cli.jar meta \
This will write, in the folder `output/myLibrary`, all the files you need to get started, including a README.md. Once modified and compiled, you can load your library with the codegen and generate clients with your own, custom-rolled logic.
95
123
96
124
### Where is Javascript???
97
125
See our [javascript library](http://github.com/swagger-api/swagger-js)--it's completely dynamic and doesn't require
@@ -116,17 +144,22 @@ There are different aspects of customizing the code generator beyond just creati
116
144
```
117
145
$ ls -1 modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/
118
146
AndroidClientCodegen.java
147
+
AsyncScalaClientCodegen.java
148
+
CSharpClientCodegen.java
119
149
JavaClientCodegen.java
120
150
JaxRSServerCodegen.java
121
151
NodeJSServerCodegen.java
122
152
ObjcClientCodegen.java
123
153
PhpClientCodegen.java
124
154
PythonClientCodegen.java
155
+
RubyClientCodegen.java
125
156
ScalaClientCodegen.java
126
157
ScalatraServerCodegen.java
158
+
SpringMVCServerCodegen.java
127
159
StaticDocCodegen.java
128
160
StaticHtmlGenerator.java
129
161
SwaggerGenerator.java
162
+
SwaggerYamlGenerator.java
130
163
TizenClientCodegen.java
131
164
```
132
165
@@ -149,7 +182,7 @@ public class MyObjcCodegen extends ObjcClientCodegen {
149
182
and specify the `classname` when running the generator:
150
183
151
184
```
152
-
-i com.mycompany.swagger.codegen.MyObjcCodegen
185
+
-l com.mycompany.swagger.codegen.MyObjcCodegen
153
186
```
154
187
155
188
Your subclass will now be loaded and overrides the `PREFIX` value in the superclass.
@@ -189,7 +222,7 @@ You can also use the codegen to generate a server for a couple different framewo
0 commit comments