@@ -46,7 +46,7 @@ public class Swagger2MarkupConverter {
46
46
private final String examplesFolderPath ;
47
47
private final String schemasFolderPath ;
48
48
private final String descriptionsFolderPath ;
49
- private final boolean isSplitDescriptions ;
49
+ private final boolean separatedDefinitions ;
50
50
private static final String OVERVIEW_DOCUMENT = "overview" ;
51
51
private static final String PATHS_DOCUMENT = "paths" ;
52
52
private static final String DEFINITIONS_DOCUMENT = "definitions" ;
@@ -57,14 +57,15 @@ public class Swagger2MarkupConverter {
57
57
* @param examplesFolderPath the folderPath where examples are stored
58
58
* @param schemasFolderPath the folderPath where (XML, JSON)-Schema files are stored
59
59
* @param descriptionsFolderPath the folderPath where descriptions are stored
60
+ * @param separatedDefinitions create separate definition files for each model definition.
60
61
*/
61
- Swagger2MarkupConverter (MarkupLanguage markupLanguage , Swagger swagger , String examplesFolderPath , String schemasFolderPath , String descriptionsFolderPath , boolean isSplitDescriptions ){
62
+ Swagger2MarkupConverter (MarkupLanguage markupLanguage , Swagger swagger , String examplesFolderPath , String schemasFolderPath , String descriptionsFolderPath , boolean separatedDefinitions ){
62
63
this .markupLanguage = markupLanguage ;
63
64
this .swagger = swagger ;
64
65
this .examplesFolderPath = examplesFolderPath ;
65
66
this .schemasFolderPath = schemasFolderPath ;
66
67
this .descriptionsFolderPath = descriptionsFolderPath ;
67
- this .isSplitDescriptions = isSplitDescriptions ;
68
+ this .separatedDefinitions = separatedDefinitions ;
68
69
}
69
70
70
71
/**
@@ -137,19 +138,19 @@ public String asString() throws IOException{
137
138
}
138
139
139
140
/**
140
- * Writes a file for the Paths (API) and a file for the Definitions (Model)
141
+ * Builds all documents and writes them to a directory
141
142
142
143
* @param directory the directory where the generated file should be stored
143
144
* @throws IOException if a file cannot be written
144
145
*/
145
146
private void buildDocuments (String directory ) throws IOException {
146
147
new OverviewDocument (swagger , markupLanguage ).build ().writeToFile (directory , OVERVIEW_DOCUMENT , StandardCharsets .UTF_8 );
147
148
new PathsDocument (swagger , markupLanguage , examplesFolderPath , descriptionsFolderPath ).build ().writeToFile (directory , PATHS_DOCUMENT , StandardCharsets .UTF_8 );
148
- new DefinitionsDocument (swagger , markupLanguage , schemasFolderPath , descriptionsFolderPath , isSplitDescriptions , directory ).build ().writeToFile (directory , DEFINITIONS_DOCUMENT , StandardCharsets .UTF_8 );
149
+ new DefinitionsDocument (swagger , markupLanguage , schemasFolderPath , descriptionsFolderPath , separatedDefinitions , directory ).build ().writeToFile (directory , DEFINITIONS_DOCUMENT , StandardCharsets .UTF_8 );
149
150
}
150
151
151
152
/**
152
- * Returns a file for the Paths (API) and a file for the Definitions (Model)
153
+ * Returns all documents as a String
153
154
154
155
* @return a the document as a String
155
156
*/
@@ -165,7 +166,7 @@ public static class Builder{
165
166
private String examplesFolderPath ;
166
167
private String schemasFolderPath ;
167
168
private String descriptionsFolderPath ;
168
- private boolean isSplitDescriptions ;
169
+ private boolean separatedDefinitions ;
169
170
private MarkupLanguage markupLanguage = MarkupLanguage .ASCIIDOC ;
170
171
171
172
/**
@@ -190,7 +191,7 @@ public static class Builder{
190
191
}
191
192
192
193
public Swagger2MarkupConverter build (){
193
- return new Swagger2MarkupConverter (markupLanguage , swagger , examplesFolderPath , schemasFolderPath , descriptionsFolderPath , isSplitDescriptions );
194
+ return new Swagger2MarkupConverter (markupLanguage , swagger , examplesFolderPath , schemasFolderPath , descriptionsFolderPath , separatedDefinitions );
194
195
}
195
196
196
197
/**
@@ -216,11 +217,11 @@ public Builder withDescriptions(String descriptionsFolderPath){
216
217
}
217
218
218
219
/**
219
- * In addition to definitions file, also create separate definition files for each entity.
220
+ * In addition to the definitions file, also create separate definition files for each model definition.
220
221
* @return the Swagger2MarkupConverter.Builder
221
222
*/
222
- public Builder withSplitDescriptions () {
223
- this .isSplitDescriptions = true ;
223
+ public Builder withSeparatedDefinitions () {
224
+ this .separatedDefinitions = true ;
224
225
return this ;
225
226
}
226
227
0 commit comments