Skip to content

Commit c237fe9

Browse files
authored
Enhancements to documentation generators (samples, default values, etc) (#790)
* enhancements to doc generators (samples, default values, etc) * add 3.3.x to PR template
1 parent 5e1c4cd commit c237fe9

59 files changed

Lines changed: 27 additions & 27 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion

bin/dynamic-html.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ fi
2727

2828
# if you've executed sbt assembly previously it will use that instead.
2929
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
30-
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dynamic-html -o samples/dynamic-html $@"
30+
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dynamic-html -o samples/documentation/dynamic-html $@"
3131

3232
java $JAVA_OPTS -jar $executable $ags

bin/html-markdown.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ fi
2727

2828
# if you've executed sbt assembly previously it will use that instead.
2929
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
30-
ags="generate -i modules/openapi-generator/src/test/resources/2_0/markdown.yaml -g html -o samples/html.md $@"
30+
ags="generate -i modules/openapi-generator/src/test/resources/2_0/markdown.yaml -g html -o samples/documentation/html.md $@"
3131

3232
java $JAVA_OPTS -jar $executable $ags

bin/html-petstore.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ fi
2727

2828
# if you've executed sbt assembly previously it will use that instead.
2929
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
30-
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g html -o samples/html $@"
30+
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g html -o samples/documentation/html $@"
3131

3232
java $JAVA_OPTS -jar $executable $ags

bin/html2-petstore.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ fi
2727

2828
# if you've executed sbt assembly previously it will use that instead.
2929
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
30-
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g html2 -o samples/html2 --additional-properties hideGenerationTimestamp=true $@"
30+
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g html2 -o samples/documentation/html2 --additional-properties hideGenerationTimestamp=true $@"
3131

3232
java $JAVA_OPTS -jar $executable $ags

bin/windows/html-petstore.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ If Not Exist %executable% (
55
)
66

77
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
8-
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g html -o samples\client\petstore\html
8+
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g html -o samples\documentation\html
99

1010
java %JAVA_OPTS% -jar %executable% %ags%

bin/windows/html2-petstore.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ If Not Exist %executable% (
55
)
66

77
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
8-
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g html2 -o samples\html2
8+
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g html2 -o samples\documentation\html2
99

1010
java %JAVA_OPTS% -jar %executable% %ags%

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ConfluenceWikiCodegen.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ public ConfluenceWikiCodegen() {
6060
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_VERSION, CodegenConstants.ARTIFACT_VERSION_DESC));
6161

6262
additionalProperties.put("appName", "OpenAPI Sample");
63-
additionalProperties.put("appDescription", "A sample openapi server");
64-
additionalProperties.put("infoUrl", "https://helloreverb.com");
65-
additionalProperties.put("infoEmail", "hello@helloreverb.com");
63+
additionalProperties.put("appDescription", "A sample OpenAPI server");
64+
additionalProperties.put("infoUrl", "https://openapi-generator.tech");
65+
additionalProperties.put("infoEmail", "team@openapitools.org");
6666
additionalProperties.put("licenseInfo", "All rights reserved");
6767
additionalProperties.put("licenseUrl", "http://apache.org/licenses/LICENSE-2.0.html");
6868
additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage);

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticDocCodegen.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public StaticDocCodegen() {
4343
outputFolder = "docs";
4444
modelTemplateFiles.put("model.mustache", ".html");
4545
apiTemplateFiles.put("operation.mustache", ".html");
46-
embeddedTemplateDir = templateDir = "swagger-static";
46+
embeddedTemplateDir = templateDir = "openapi-static";
4747

4848
cliOptions.add(new CliOption(CodegenConstants.INVOKER_PACKAGE, CodegenConstants.INVOKER_PACKAGE_DESC));
4949
cliOptions.add(new CliOption(CodegenConstants.GROUP_ID, CodegenConstants.GROUP_ID_DESC));
@@ -94,8 +94,8 @@ public String getHelp() {
9494
}
9595

9696
@Override
97-
public String escapeReservedWord(String name) {
98-
if(this.reservedWordsMappings().containsKey(name)) {
97+
public String escapeReservedWord(String name) {
98+
if (this.reservedWordsMappings().containsKey(name)) {
9999
return this.reservedWordsMappings().get(name);
100100
}
101101
return "_" + name;
@@ -121,5 +121,5 @@ public String escapeQuotationMark(String input) {
121121
public String escapeUnsafeCharacters(String input) {
122122
// just return the original string
123123
return input;
124-
}
124+
}
125125
}

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtml2Generator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ public StaticHtml2Generator() {
8282
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_VERSION, CodegenConstants.ARTIFACT_VERSION_DESC));
8383

8484
additionalProperties.put("appName", "OpenAPI Sample");
85-
additionalProperties.put("appDescription", "A sample openapi server");
85+
additionalProperties.put("appDescription", "A sample OpenAPI server");
8686
additionalProperties.put("infoUrl", "https://openapi-generator.tech");
87-
additionalProperties.put("infoEmail", "contributors@openapitools.org");
87+
additionalProperties.put("infoEmail", "team@openapitools.org");
8888
additionalProperties.put("licenseInfo", "All rights reserved");
8989
additionalProperties.put("licenseUrl", "http://apache.org/licenses/LICENSE-2.0.html");
9090
additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage);
@@ -180,7 +180,7 @@ public void preprocessOpenAPI(OpenAPI openAPI) {
180180

181181
Map<String, Object> vendorExtensions = openAPI.getExtensions();
182182
if (vendorExtensions != null) {
183-
for(Map.Entry<String, Object> vendorExtension: vendorExtensions.entrySet()) {
183+
for (Map.Entry<String, Object> vendorExtension : vendorExtensions.entrySet()) {
184184
// Vendor extensions could be Maps (objects). If we wanted to iterate through them in our template files
185185
// without knowing the keys beforehand, the default `toString` method renders them unusable. Instead, we
186186
// convert them to JSON strings now, which means we can easily use them later.

0 commit comments

Comments
 (0)