mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-10 12:26:11 +00:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user