Issue 4416 (Assist escapeReservedWord with custom mappings) (#4480)

* Preliminary implementation for issue-4416

* Updated README.md with  reserved-words-mappings  parameter.
This commit is contained in:
Alex Nolasco
2017-01-09 05:22:25 -05:00
committed by wing328
parent 81b5b78fc2
commit 26ead9b58f
41 changed files with 214 additions and 64 deletions

View File

@@ -117,7 +117,11 @@ public class Generate implements Runnable {
@Option(name = {"--http-user-agent"}, title = "http user agent", description = CodegenConstants.HTTP_USER_AGENT_DESC)
private String httpUserAgent;
@Option(name = {"--reserved-words-mappings"}, title = "import mappings",
description = "specifies how a reserved name should be escaped to. Otherwise, the default _<name> is used. For example id=identifier")
private String reservedWordsMappings;
@Override
public void run() {
@@ -217,7 +221,7 @@ public class Generate implements Runnable {
applyTypeMappingsKvp(typeMappings, configurator);
applyAdditionalPropertiesKvp(additionalProperties, configurator);
applyLanguageSpecificPrimitivesCsv(languageSpecificPrimitives, configurator);
applyReservedWordsMappingsKvp(reservedWordsMappings, configurator);
final ClientOptInput clientOptInput = configurator.toClientOptInput();
new DefaultGenerator().opts(clientOptInput).generate();