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
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -212,6 +212,36 @@ to the code generator like this:
212
212
213
213
Great for creating libraries on your ci server, from the [Swagger Editor](http://editor.swagger.io)... or while coding on an airplane.
214
214
215
+
### Selective generation
216
+
You may not want to generate *all* models in your project. Likewise you may want just one or two apis to be written. If that's the case, you can use system properties to control the output:
217
+
218
+
The default is generate *everything* supported by the specific library. Once you enable a feature, it will restrict the contents generated:
219
+
220
+
```
221
+
# generate only models
222
+
java -Dmodels {opts}
223
+
224
+
# generate only apis
225
+
java -Dapis {opts}
226
+
227
+
# generate only supporting files
228
+
java -DsupportingFiles
229
+
230
+
# generate models and supporting files
231
+
java -Dmodels -DsupportingFiles
232
+
```
233
+
234
+
To control the specific files being generated, you can pass a CSV list of what you want:
235
+
```
236
+
# generate the User and Pet models only
237
+
-Dmodels=User,Pet
238
+
239
+
# generate the User model and the supportingFile `StringUtil.java`:
240
+
-Dmodels=User -DsupportingFiles=StringUtil.java
241
+
```
242
+
243
+
When using selective generation, _only_ the templates needed for the specific generation will be used.
244
+
215
245
### Customizing the generator
216
246
217
247
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:
0 commit comments