mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-06 02:25:20 +00:00
Enhancements to documentation generators (samples, default values, etc) (#790)
* enhancements to doc generators (samples, default values, etc) * add 3.3.x to PR template
This commit is contained in:
parent
5e1c4cde50
commit
c237fe9f1c
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -2,7 +2,7 @@
|
||||
|
||||
- [ ] Read the [contribution guidelines](https://github.com/openapitools/openapi-generator/blob/master/CONTRIBUTING.md).
|
||||
- [ ] Ran the shell script under `./bin/` to update Petstore sample so that CIs can verify the change. (For instance, only need to run `./bin/{LANG}-petstore.sh` and `./bin/security/{LANG}-petstore.sh` if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in `.\bin\windows\`.
|
||||
- [ ] Filed the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master`, `4.0.x`. Default: `master`.
|
||||
- [ ] Filed the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master`, `3.3.x`, `4.0.x`. Default: `master`.
|
||||
- [ ] Copied the [technical committee](https://github.com/openapitools/openapi-generator/#62---openapi-generator-technical-committee) to review the pull request if your PR is targeting a particular programming language.
|
||||
|
||||
### Description of the PR
|
||||
|
@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dynamic-html -o samples/dynamic-html $@"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dynamic-html -o samples/documentation/dynamic-html $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/markdown.yaml -g html -o samples/html.md $@"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/markdown.yaml -g html -o samples/documentation/html.md $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g html -o samples/html $@"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g html -o samples/documentation/html $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g html2 -o samples/html2 --additional-properties hideGenerationTimestamp=true $@"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g html2 -o samples/documentation/html2 --additional-properties hideGenerationTimestamp=true $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
@ -5,6 +5,6 @@ If Not Exist %executable% (
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g html -o samples\client\petstore\html
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g html -o samples\documentation\html
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
|
@ -5,6 +5,6 @@ If Not Exist %executable% (
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g html2 -o samples\html2
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g html2 -o samples\documentation\html2
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
|
@ -60,9 +60,9 @@ public class ConfluenceWikiCodegen extends DefaultCodegen implements CodegenConf
|
||||
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_VERSION, CodegenConstants.ARTIFACT_VERSION_DESC));
|
||||
|
||||
additionalProperties.put("appName", "OpenAPI Sample");
|
||||
additionalProperties.put("appDescription", "A sample openapi server");
|
||||
additionalProperties.put("infoUrl", "https://helloreverb.com");
|
||||
additionalProperties.put("infoEmail", "hello@helloreverb.com");
|
||||
additionalProperties.put("appDescription", "A sample OpenAPI server");
|
||||
additionalProperties.put("infoUrl", "https://openapi-generator.tech");
|
||||
additionalProperties.put("infoEmail", "team@openapitools.org");
|
||||
additionalProperties.put("licenseInfo", "All rights reserved");
|
||||
additionalProperties.put("licenseUrl", "http://apache.org/licenses/LICENSE-2.0.html");
|
||||
additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage);
|
||||
|
@ -43,7 +43,7 @@ public class StaticDocCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
outputFolder = "docs";
|
||||
modelTemplateFiles.put("model.mustache", ".html");
|
||||
apiTemplateFiles.put("operation.mustache", ".html");
|
||||
embeddedTemplateDir = templateDir = "swagger-static";
|
||||
embeddedTemplateDir = templateDir = "openapi-static";
|
||||
|
||||
cliOptions.add(new CliOption(CodegenConstants.INVOKER_PACKAGE, CodegenConstants.INVOKER_PACKAGE_DESC));
|
||||
cliOptions.add(new CliOption(CodegenConstants.GROUP_ID, CodegenConstants.GROUP_ID_DESC));
|
||||
@ -94,8 +94,8 @@ public class StaticDocCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String escapeReservedWord(String name) {
|
||||
if(this.reservedWordsMappings().containsKey(name)) {
|
||||
public String escapeReservedWord(String name) {
|
||||
if (this.reservedWordsMappings().containsKey(name)) {
|
||||
return this.reservedWordsMappings().get(name);
|
||||
}
|
||||
return "_" + name;
|
||||
@ -121,5 +121,5 @@ public class StaticDocCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
public String escapeUnsafeCharacters(String input) {
|
||||
// just return the original string
|
||||
return input;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -82,9 +82,9 @@ public class StaticHtml2Generator extends DefaultCodegen implements CodegenConfi
|
||||
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_VERSION, CodegenConstants.ARTIFACT_VERSION_DESC));
|
||||
|
||||
additionalProperties.put("appName", "OpenAPI Sample");
|
||||
additionalProperties.put("appDescription", "A sample openapi server");
|
||||
additionalProperties.put("appDescription", "A sample OpenAPI server");
|
||||
additionalProperties.put("infoUrl", "https://openapi-generator.tech");
|
||||
additionalProperties.put("infoEmail", "contributors@openapitools.org");
|
||||
additionalProperties.put("infoEmail", "team@openapitools.org");
|
||||
additionalProperties.put("licenseInfo", "All rights reserved");
|
||||
additionalProperties.put("licenseUrl", "http://apache.org/licenses/LICENSE-2.0.html");
|
||||
additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage);
|
||||
@ -180,7 +180,7 @@ public class StaticHtml2Generator extends DefaultCodegen implements CodegenConfi
|
||||
|
||||
Map<String, Object> vendorExtensions = openAPI.getExtensions();
|
||||
if (vendorExtensions != null) {
|
||||
for(Map.Entry<String, Object> vendorExtension: vendorExtensions.entrySet()) {
|
||||
for (Map.Entry<String, Object> vendorExtension : vendorExtensions.entrySet()) {
|
||||
// Vendor extensions could be Maps (objects). If we wanted to iterate through them in our template files
|
||||
// without knowing the keys beforehand, the default `toString` method renders them unusable. Instead, we
|
||||
// convert them to JSON strings now, which means we can easily use them later.
|
||||
|
@ -69,9 +69,9 @@ public class StaticHtmlGenerator extends DefaultCodegen implements CodegenConfig
|
||||
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_VERSION, CodegenConstants.ARTIFACT_VERSION_DESC));
|
||||
|
||||
additionalProperties.put("appName", "OpenAPI Sample");
|
||||
additionalProperties.put("appDescription", "A sample openapi server");
|
||||
additionalProperties.put("infoUrl", "https://helloreverb.com");
|
||||
additionalProperties.put("infoEmail", "hello@helloreverb.com");
|
||||
additionalProperties.put("appDescription", "A sample OpenAPI server");
|
||||
additionalProperties.put("infoUrl", "https//openapi-generator.tech");
|
||||
additionalProperties.put("infoEmail", "team@openapitools.org");
|
||||
additionalProperties.put("licenseInfo", "All rights reserved");
|
||||
additionalProperties.put("licenseUrl", "http://apache.org/licenses/LICENSE-2.0.html");
|
||||
additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage);
|
||||
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
@ -1 +1 @@
|
||||
3.0.0-SNAPSHOT
|
||||
3.2.1-SNAPSHOT
|
@ -0,0 +1 @@
|
||||
3.2.1-SNAPSHOT
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
1
samples/documentation/html/.openapi-generator/VERSION
Normal file
1
samples/documentation/html/.openapi-generator/VERSION
Normal file
@ -0,0 +1 @@
|
||||
3.2.1-SNAPSHOT
|
@ -181,8 +181,8 @@ font-style: italic;
|
||||
<body>
|
||||
<h1>OpenAPI Petstore</h1>
|
||||
<div class="app-desc">This is a sample server Petstore server. For this sample, you can use the api key <code>special-key</code> to test the authorization filters.</div>
|
||||
<div class="app-desc">More information: <a href="https://helloreverb.com">https://helloreverb.com</a></div>
|
||||
<div class="app-desc">Contact Info: <a href="hello@helloreverb.com">hello@helloreverb.com</a></div>
|
||||
<div class="app-desc">More information: <a href="https//openapi-generator.tech">https//openapi-generator.tech</a></div>
|
||||
<div class="app-desc">Contact Info: <a href="team@openapitools.org">team@openapitools.org</a></div>
|
||||
<div class="app-desc">Version: 1.0.0</div>
|
||||
<div class="app-desc">BasePath:/v2</div>
|
||||
<div class="license-info">Apache-2.0</div>
|
1
samples/documentation/html2/.openapi-generator/VERSION
Normal file
1
samples/documentation/html2/.openapi-generator/VERSION
Normal file
@ -0,0 +1 @@
|
||||
3.2.1-SNAPSHOT
|
@ -8103,7 +8103,7 @@ $(document).ready(function() {
|
||||
<div id="api-_footer">
|
||||
<p>Suggestions, contact, support and error reporting;
|
||||
<div class="app-desc">Information URL: <a href="https://openapi-generator.tech">https://openapi-generator.tech</a></div>
|
||||
<div class="app-desc">Contact Info: <a href="contributors@openapitools.org">contributors@openapitools.org</a></div>
|
||||
<div class="app-desc">Contact Info: <a href="team@openapitools.org">team@openapitools.org</a></div>
|
||||
</p>
|
||||
<div class="license-info">Apache-2.0</div>
|
||||
<div class="license-url">http://www.apache.org/licenses/LICENSE-2.0.html</div>
|
@ -1 +0,0 @@
|
||||
3.0.0-SNAPSHOT
|
@ -1 +0,0 @@
|
||||
3.0.0-SNAPSHOT
|
@ -1 +0,0 @@
|
||||
3.1.2-SNAPSHOT
|
Loading…
Reference in New Issue
Block a user