Fix #5653 so body parameter schema link matches model anchor (#5655)

* Sync with upstream/master

* Fix for issue #5653

Override the toModelName(String name) [from DefaultCodegen] in StaticHtmlGenerator to return `name` unmodified
so that the anchors for models and the href for body parameters match case (do not convert model names to TitleCase.

* Revert "Fix for issue #5653"

This reverts commit 5472aa10a3101ea5dd417bc509c5d9c5351a3d66.

* Fix for issue #5653

Override the toModelName(String name) [from DefaultCodegen] in StaticHtmlGenerator to return `name` unmodified
so that the anchors for models and the href for body parameters match case (do not convert model names to TitleCase.
This commit is contained in:
David Biesack 2017-05-18 03:16:42 -04:00 committed by wing328
parent 4417bb6b32
commit 632a2e3949
2 changed files with 9 additions and 0 deletions

View File

@ -170,6 +170,14 @@ public class StaticHtmlGenerator extends DefaultCodegen implements CodegenConfig
return markdownConverter.toHtml(input); return markdownConverter.toHtml(input);
} }
// DefaultCodegen converts model names to UpperCamelCase
// but for static HTML, we want the names to be preserved as coded in the OpenApi
// so HTML links work
@Override
public String toModelName(final String name) {
return name;
}
public void preprocessSwagger(Swagger swagger) { public void preprocessSwagger(Swagger swagger) {
Info info = swagger.getInfo(); Info info = swagger.getInfo();
info.setDescription(toHtml(info.getDescription())); info.setDescription(toHtml(info.getDescription()));

View File

@ -0,0 +1 @@
2.2.3-SNAPSHOT