mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 19:08:52 +00:00
Options to allow unicode character in identifier names (#4508)
* Added option to allow unicode identifiers in class names, method names etc. Added option to allow keeping of underscore characters in class names, methods names, etc. Unicode identifiers are supported by some languages, like Java, but the codegen will remove all non ASCII letters by default. Users might want to separate different parts of names using extended punctuation connector characters, like "_, ‿, ⁀, ⁔, ・, ︳, ︴, ﹍, ﹎, ﹏, _, ・". Underscores cannot be used to separate different parts of the name as they're removed by default by the codegen, the second option allows underscore characters if the user so desires. Both options can be used separately if needed, for example one might allow extended punctuation connector characters, but still disallow underscore. * Added new command line options to all required unit tests. * Added KEEP_UNDERSCORES and ALLOW_UNICODE_IDENTIFIERS to Bash tests. * When KEEP_UNDERSCORES is set don't camelize the names, keep the identifier case as is (you probably don't want camel case + snake case, just snake case when KEEP_UNDERSCORES is set). Added unit tests to verify how the case is computed for various scenarios. * Reworked pull request to only include changes related to supporting unicode characters in identifiers (removed references to keep underscores). * These methods and classes can be static again.
This commit is contained in:
parent
029728d851
commit
3b3f2d2fd6
@ -12,6 +12,8 @@ public class CodegenConstants {
|
||||
|
||||
public static final String TEMPLATE_DIR = "templateDir";
|
||||
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS = "allowUnicodeIdentifiers";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_DESC = "boolean, toggles whether unicode identifiers are allowed in names or not, default is false";
|
||||
|
||||
public static final String INVOKER_PACKAGE = "invokerPackage";
|
||||
public static final String INVOKER_PACKAGE_DESC = "root package for generated code";
|
||||
|
@ -107,6 +107,7 @@ public class DefaultCodegen {
|
||||
protected String library;
|
||||
protected Boolean sortParamsByRequiredFlag = true;
|
||||
protected Boolean ensureUniqueParams = true;
|
||||
protected Boolean allowUnicodeIdentifiers = false;
|
||||
protected String gitUserId, gitRepoId, releaseNote;
|
||||
protected String httpUserAgent;
|
||||
protected Boolean hideGenerationTimestamp = true;
|
||||
@ -144,6 +145,11 @@ public class DefaultCodegen {
|
||||
.get(CodegenConstants.ENSURE_UNIQUE_PARAMS).toString()));
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS)) {
|
||||
this.setAllowUnicodeIdentifiers(Boolean.valueOf(additionalProperties
|
||||
.get(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS).toString()));
|
||||
}
|
||||
|
||||
if(additionalProperties.containsKey(CodegenConstants.MODEL_NAME_PREFIX)){
|
||||
this.setModelNamePrefix((String) additionalProperties.get(CodegenConstants.MODEL_NAME_PREFIX));
|
||||
}
|
||||
@ -151,7 +157,6 @@ public class DefaultCodegen {
|
||||
if(additionalProperties.containsKey(CodegenConstants.MODEL_NAME_SUFFIX)){
|
||||
this.setModelNameSuffix((String) additionalProperties.get(CodegenConstants.MODEL_NAME_SUFFIX));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// override with any special post-processing for all models
|
||||
@ -582,6 +587,10 @@ public class DefaultCodegen {
|
||||
this.ensureUniqueParams = ensureUniqueParams;
|
||||
}
|
||||
|
||||
public void setAllowUnicodeIdentifiers(Boolean allowUnicodeIdentifiers) {
|
||||
this.allowUnicodeIdentifiers = allowUnicodeIdentifiers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the regular expression/JSON schema pattern (http://json-schema.org/latest/json-schema-validation.html#anchor33)
|
||||
*
|
||||
@ -836,6 +845,10 @@ public class DefaultCodegen {
|
||||
cliOptions.add(CliOption.newBoolean(CodegenConstants.ENSURE_UNIQUE_PARAMS, CodegenConstants
|
||||
.ENSURE_UNIQUE_PARAMS_DESC).defaultValue(Boolean.TRUE.toString()));
|
||||
|
||||
//name formatting options
|
||||
cliOptions.add(CliOption.newBoolean(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, CodegenConstants
|
||||
.ALLOW_UNICODE_IDENTIFIERS_DESC).defaultValue(Boolean.FALSE.toString()));
|
||||
|
||||
// initialize special character mapping
|
||||
initalizeSpecialCharacterMapping();
|
||||
}
|
||||
@ -3257,7 +3270,14 @@ public class DefaultCodegen {
|
||||
|
||||
// remove everything else other than word, number and _
|
||||
// $php_variable => php_variable
|
||||
return name.replaceAll("[^a-zA-Z0-9_]", "");
|
||||
if (allowUnicodeIdentifiers) { //could be converted to a single line with ?: operator
|
||||
name = Pattern.compile("\\W", Pattern.UNICODE_CHARACTER_CLASS).matcher(name).replaceAll("");
|
||||
}
|
||||
else {
|
||||
name = name.replaceAll("\\W", "");
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,6 +1,9 @@
|
||||
package io.swagger.codegen.languages;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import com.sun.org.apache.bcel.internal.classfile.Code;
|
||||
|
||||
import io.swagger.codegen.CodegenConstants;
|
||||
import io.swagger.codegen.CodegenType;
|
||||
import io.swagger.codegen.CodegenModel;
|
||||
@ -141,6 +144,10 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
CodegenConstants.NON_PUBLIC_API_DESC,
|
||||
this.nonPublicApi);
|
||||
|
||||
addSwitch(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS,
|
||||
CodegenConstants.ALLOW_UNICODE_IDENTIFIERS_DESC,
|
||||
this.allowUnicodeIdentifiers);
|
||||
|
||||
regexModifiers = new HashMap<Character, String>();
|
||||
regexModifiers.put('i', "IgnoreCase");
|
||||
regexModifiers.put('m', "Multiline");
|
||||
|
@ -24,6 +24,20 @@ public class CodegenTest {
|
||||
Assert.assertEquals(codegen.sanitizeTag("1foo"), "_1foo");
|
||||
}
|
||||
|
||||
@Test(description = "test camelize")
|
||||
public void camelizeNamesTest() {
|
||||
final DefaultCodegen codegen = new DefaultCodegen();
|
||||
|
||||
Assert.assertEquals(codegen.camelize("foo"), "Foo");
|
||||
Assert.assertEquals(codegen.camelize(".foo"), "Foo");
|
||||
Assert.assertEquals(codegen.camelize(".foo.bar"), "FooBar");
|
||||
Assert.assertEquals(codegen.camelize("foo$bar"), "Foo$bar");
|
||||
Assert.assertEquals(codegen.camelize("foo_bar"), "FooBar");
|
||||
Assert.assertEquals(codegen.camelize("foo_bar_baz"), "FooBarBaz");
|
||||
Assert.assertEquals(codegen.camelize("foo/bar.baz"), "FooBarBaz");
|
||||
Assert.assertEquals(codegen.camelize("/foo/bar/baz.qux/corge"), "FooBarBazQuxCorge");
|
||||
}
|
||||
|
||||
@Test(description = "read a file upload param from a 2.0 spec")
|
||||
public void fileUploadParamTest() {
|
||||
final Swagger model = parseAndPrepareSwagger("src/test/resources/2_0/petstore.json");
|
||||
|
@ -48,6 +48,8 @@ public class AndroidClientOptionsTest extends AbstractOptionsTest {
|
||||
times = 1;
|
||||
clientCodegen.setSerializableModel(Boolean.valueOf(AndroidClientOptionsProvider.SERIALIZABLE_MODEL_VALUE));
|
||||
times = 1;
|
||||
clientCodegen.setAllowUnicodeIdentifiers(Boolean.valueOf(AndroidClientOptionsProvider.ALLOW_UNICODE_IDENTIFIERS_VALUE));
|
||||
times = 1;
|
||||
}};
|
||||
}
|
||||
}
|
||||
|
@ -50,6 +50,9 @@ public class BashClientOptionsTest extends AbstractOptionsTest {
|
||||
clientCodegen.setApiKeyAuthEnvironmentVariable(
|
||||
BashClientOptionsProvider.APIKEY_AUTH_ENVIRONMENT_VARIABLE_NAME);
|
||||
times = 1;
|
||||
clientCodegen.setAllowUnicodeIdentifiers(Boolean.valueOf(BashClientOptionsProvider.ALLOW_UNICODE_IDENTIFIERS_VALUE));
|
||||
times = 1;
|
||||
|
||||
}};
|
||||
}
|
||||
}
|
||||
|
@ -54,6 +54,9 @@ public class CSharpClientOptionsTest extends AbstractOptionsTest {
|
||||
times = 1;
|
||||
clientCodegen.setInterfacePrefix("X");
|
||||
times = 1;
|
||||
clientCodegen.setAllowUnicodeIdentifiers(Boolean.valueOf(CSharpClientOptionsProvider.ALLOW_UNICODE_IDENTIFIERS_VALUE));
|
||||
times = 1;
|
||||
|
||||
}};
|
||||
}
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ public class JavaScriptModelEnumTest {
|
||||
}
|
||||
|
||||
@Test(description = "test enum array model")
|
||||
public void enumArrayMdoelTest() {
|
||||
public void enumArrayModelTest() {
|
||||
final Swagger model = new SwaggerParser().read("src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml");
|
||||
final DefaultCodegen codegen = new JavascriptClientCodegen();
|
||||
final Model definition = model.getDefinitions().get("EnumArrays");
|
||||
@ -126,7 +126,7 @@ public class JavaScriptModelEnumTest {
|
||||
}
|
||||
|
||||
@Test(description = "test enum model for values (numeric, string, etc)")
|
||||
public void enumMdoelValueTest() {
|
||||
public void enumModelValueTest() {
|
||||
final Swagger model = new SwaggerParser().read("src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml");
|
||||
final DefaultCodegen codegen = new JavascriptClientCodegen();
|
||||
final Model definition = model.getDefinitions().get("Enum_Test");
|
||||
|
@ -4,6 +4,8 @@ import io.swagger.codegen.CodegenConstants;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import com.sun.org.apache.bcel.internal.classfile.Code;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class AkkaScalaClientOptionsProvider implements OptionsProvider {
|
||||
@ -12,6 +14,7 @@ public class AkkaScalaClientOptionsProvider implements OptionsProvider {
|
||||
public static final String API_PACKAGE_VALUE = "apiPackage";
|
||||
public static final String SORT_PARAMS_VALUE = "false";
|
||||
public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
@ -26,6 +29,7 @@ public class AkkaScalaClientOptionsProvider implements OptionsProvider {
|
||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||
.put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE)
|
||||
.put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE)
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,7 @@ public class AndroidClientOptionsProvider implements OptionsProvider {
|
||||
public static final String ANDROID_MAVEN_GRADLE_PLUGIN_VALUE = "true";
|
||||
public static final String LIBRARY_VALUE = "httpclient";
|
||||
public static final String SERIALIZABLE_MODEL_VALUE = "false";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
@ -41,6 +42,7 @@ public class AndroidClientOptionsProvider implements OptionsProvider {
|
||||
.put(AndroidClientCodegen.USE_ANDROID_MAVEN_GRADLE_PLUGIN, ANDROID_MAVEN_GRADLE_PLUGIN_VALUE)
|
||||
.put(CodegenConstants.LIBRARY, LIBRARY_VALUE)
|
||||
.put(CodegenConstants.SERIALIZABLE_MODEL, SERIALIZABLE_MODEL_VALUE)
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,7 @@ public class AsyncScalaClientOptionsProvider implements OptionsProvider {
|
||||
public static final String API_PACKAGE_VALUE = "apiPackage";
|
||||
public static final String SORT_PARAMS_VALUE = "false";
|
||||
public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
@ -26,6 +27,7 @@ public class AsyncScalaClientOptionsProvider implements OptionsProvider {
|
||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||
.put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE)
|
||||
.put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE)
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,9 @@ public class BashClientOptionsProvider implements OptionsProvider {
|
||||
= "PETSTORE_BASIC_AUTH";
|
||||
public static final String APIKEY_AUTH_ENVIRONMENT_VARIABLE_NAME
|
||||
= "PETSTORE_APIKEY";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE
|
||||
= "false";
|
||||
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
@ -48,6 +51,7 @@ public class BashClientOptionsProvider implements OptionsProvider {
|
||||
APIKEY_AUTH_ENVIRONMENT_VARIABLE_NAME)
|
||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, "false")
|
||||
.put(CodegenConstants.ENSURE_UNIQUE_PARAMS, "false")
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.build();
|
||||
|
||||
}
|
||||
|
@ -11,7 +11,8 @@ public class CSharpClientOptionsProvider implements OptionsProvider {
|
||||
public static final String PACKAGE_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
||||
public static final String SOURCE_FOLDER_VALUE = "src_csharp";
|
||||
public static final String PACKAGE_GUID_VALUE = "{894EAEBB-649A-498C-A735-10D0BD7B73E0}";
|
||||
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
return "csharp";
|
||||
@ -37,6 +38,7 @@ public class CSharpClientOptionsProvider implements OptionsProvider {
|
||||
.put(CodegenConstants.GENERATE_PROPERTY_CHANGED, "true")
|
||||
.put(CodegenConstants.NON_PUBLIC_API, "true")
|
||||
.put(CodegenConstants.INTERFACE_PREFIX, "X")
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -15,6 +15,8 @@ public class DartClientOptionsProvider implements OptionsProvider {
|
||||
public static final String PUB_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
||||
public static final String PUB_DESCRIPTION_VALUE = "Swagger API client dart";
|
||||
public static final String SOURCE_FOLDER_VALUE = "src";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
@ -31,6 +33,7 @@ public class DartClientOptionsProvider implements OptionsProvider {
|
||||
.put(DartClientCodegen.PUB_VERSION, PUB_VERSION_VALUE)
|
||||
.put(DartClientCodegen.PUB_DESCRIPTION, PUB_DESCRIPTION_VALUE)
|
||||
.put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE)
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,8 @@ import java.util.Map;
|
||||
public class GoServerOptionsProvider implements OptionsProvider {
|
||||
public static final String SORT_PARAMS_VALUE = "false";
|
||||
public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
@ -20,6 +22,7 @@ public class GoServerOptionsProvider implements OptionsProvider {
|
||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||
return builder.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||
.put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE)
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,8 @@ public class HaskellServantOptionsProvider implements OptionsProvider {
|
||||
public static final String API_PACKAGE_VALUE = "Api";
|
||||
public static final String SORT_PARAMS_VALUE = "false";
|
||||
public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
@ -24,6 +26,7 @@ public class HaskellServantOptionsProvider implements OptionsProvider {
|
||||
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||
.put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE)
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,8 @@ public class JavaOptionsProvider implements OptionsProvider {
|
||||
public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true";
|
||||
//public static final String SUPPORT_JAVA6 = "true";
|
||||
public static final String USE_BEANVALIDATION = "false";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
|
||||
private ImmutableMap<String, String> options;
|
||||
|
||||
@ -48,7 +50,8 @@ public class JavaOptionsProvider implements OptionsProvider {
|
||||
.put(CodegenConstants.SERIALIZE_BIG_DECIMAL_AS_STRING, "true")
|
||||
.put(JavaClientCodegen.DATE_LIBRARY, "joda")
|
||||
.put("hideGenerationTimestamp", "true")
|
||||
//.put("supportJava6", "true")
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
//.put("supportJava6", "true")
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -29,6 +29,8 @@ public class JavaScriptOptionsProvider implements OptionsProvider {
|
||||
public static final String USE_INHERITANCE_VALUE = "false";
|
||||
public static final String EMIT_MODEL_METHODS_VALUE = "true";
|
||||
public static final String EMIT_JS_DOC_VALUE = "false";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
|
||||
private ImmutableMap<String, String> options;
|
||||
|
||||
@ -59,6 +61,7 @@ public class JavaScriptOptionsProvider implements OptionsProvider {
|
||||
.put(JavascriptClientCodegen.EMIT_MODEL_METHODS, EMIT_MODEL_METHODS_VALUE)
|
||||
.put(JavascriptClientCodegen.EMIT_JS_DOC, EMIT_JS_DOC_VALUE)
|
||||
.put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true")
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,8 @@ import java.util.Map;
|
||||
public class JavascriptClosureAnularClientOptionsProvider implements OptionsProvider {
|
||||
public static final String SORT_PARAMS_VALUE = "false";
|
||||
public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
@ -21,6 +23,7 @@ public class JavascriptClosureAnularClientOptionsProvider implements OptionsProv
|
||||
return builder.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||
.put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE)
|
||||
.put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true")
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,8 @@ public class JaxRSServerOptionsProvider implements OptionsProvider {
|
||||
public static final String IMPL_FOLDER_VALUE = "src/main/java/impl";
|
||||
public static final String JAXRS_DEFAULT_LIBRARY_VALUE = "jersey1";
|
||||
public static final String USE_BEANVALIDATION = "true";
|
||||
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isServer() {
|
||||
@ -64,7 +65,8 @@ public class JaxRSServerOptionsProvider implements OptionsProvider {
|
||||
.put(CodegenConstants.SERIALIZE_BIG_DECIMAL_AS_STRING, "true")
|
||||
//.put(JavaClientCodegen.DATE_LIBRARY, "joda")
|
||||
.put("hideGenerationTimestamp", "true")
|
||||
.put(JavaCXFServerCodegen.USE_BEANVALIDATION, USE_BEANVALIDATION);
|
||||
.put(JavaCXFServerCodegen.USE_BEANVALIDATION, USE_BEANVALIDATION)
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE);
|
||||
|
||||
return builder.build();
|
||||
}
|
||||
|
@ -19,6 +19,8 @@ public class LumenServerOptionsProvider implements OptionsProvider {
|
||||
public static final String GIT_USER_ID_VALUE = "gitSwaggerPhp";
|
||||
public static final String GIT_REPO_ID_VALUE = "git-swagger-php";
|
||||
public static final String ARTIFACT_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
@ -39,6 +41,7 @@ public class LumenServerOptionsProvider implements OptionsProvider {
|
||||
.put(CodegenConstants.GIT_USER_ID, GIT_USER_ID_VALUE)
|
||||
.put(CodegenConstants.GIT_REPO_ID, GIT_REPO_ID_VALUE)
|
||||
.put(CodegenConstants.ARTIFACT_VERSION, ARTIFACT_VERSION_VALUE)
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,8 @@ public class NancyFXServerOptionsProvider implements OptionsProvider {
|
||||
public static final String PACKAGE_NAME_VALUE = "swagger_server_nancyfx";
|
||||
public static final String PACKAGE_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
||||
public static final String SOURCE_FOLDER_VALUE = "src_nancyfx";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
@ -27,6 +29,8 @@ public class NancyFXServerOptionsProvider implements OptionsProvider {
|
||||
.put(USE_COLLECTION, "false")
|
||||
.put(RETURN_ICOLLECTION, "false")
|
||||
.put(INTERFACE_PREFIX, "X")
|
||||
.put(ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,8 @@ public class NodeJSServerOptionsProvider implements OptionsProvider {
|
||||
public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true";
|
||||
public static final String GOOGLE_CLOUD_FUNCTIONS = "false";
|
||||
public static final String EXPORTED_NAME = "exported";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
@ -24,6 +26,7 @@ public class NodeJSServerOptionsProvider implements OptionsProvider {
|
||||
.put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE)
|
||||
.put(NodeJSServerCodegen.GOOGLE_CLOUD_FUNCTIONS, GOOGLE_CLOUD_FUNCTIONS)
|
||||
.put(NodeJSServerCodegen.EXPORTED_NAME, EXPORTED_NAME)
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,8 @@ public class PhpClientOptionsProvider implements OptionsProvider {
|
||||
public static final String GIT_USER_ID_VALUE = "gitSwaggerPhp";
|
||||
public static final String GIT_REPO_ID_VALUE = "git-swagger-client-php";
|
||||
public static final String ARTIFACT_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
@ -44,6 +46,7 @@ public class PhpClientOptionsProvider implements OptionsProvider {
|
||||
.put(CodegenConstants.GIT_REPO_ID, GIT_REPO_ID_VALUE)
|
||||
.put(CodegenConstants.ARTIFACT_VERSION, ARTIFACT_VERSION_VALUE)
|
||||
.put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true")
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,8 @@ import java.util.Map;
|
||||
public class Qt5CPPOptionsProvider implements OptionsProvider {
|
||||
public static final String SORT_PARAMS_VALUE = "false";
|
||||
public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
@ -20,6 +22,7 @@ public class Qt5CPPOptionsProvider implements OptionsProvider {
|
||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||
return builder.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||
.put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE)
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,8 @@ public class RubyClientOptionsProvider implements OptionsProvider {
|
||||
public static final String GEM_DESCRIPTION_VALUE = "description";
|
||||
public static final String GEM_AUTHOR_VALUE = "foo";
|
||||
public static final String GEM_AUTHOR_EMAIL_VALUE = "foo";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
@ -42,6 +44,7 @@ public class RubyClientOptionsProvider implements OptionsProvider {
|
||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||
.put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE)
|
||||
.put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true")
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,8 @@ public class ScalaClientOptionsProvider implements OptionsProvider {
|
||||
public static final String SORT_PARAMS_VALUE = "false";
|
||||
public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true";
|
||||
public static final String MODEL_PROPERTY_NAMING = "modelPropertyNaming";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
@ -28,6 +30,7 @@ public class ScalaClientOptionsProvider implements OptionsProvider {
|
||||
.put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE)
|
||||
.put(CodegenConstants.MODEL_PROPERTY_NAMING, MODEL_PROPERTY_NAMING)
|
||||
.put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE)
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,8 @@ public class ScalatraServerOptionsProvider implements OptionsProvider {
|
||||
public static final String API_PACKAGE_VALUE = "apiPackage";
|
||||
public static final String SORT_PARAMS_VALUE = "false";
|
||||
public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
@ -26,6 +28,7 @@ public class ScalatraServerOptionsProvider implements OptionsProvider {
|
||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||
.put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE)
|
||||
.put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE)
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@ import java.util.Map;
|
||||
public class SilexServerOptionsProvider implements OptionsProvider {
|
||||
public static final String SORT_PARAMS_VALUE = "false";
|
||||
public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
@ -20,6 +21,7 @@ public class SilexServerOptionsProvider implements OptionsProvider {
|
||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||
return builder.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||
.put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE)
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,8 @@ import java.util.Map;
|
||||
public class SlimFrameworkServerOptionsProvider implements OptionsProvider {
|
||||
public static final String SORT_PARAMS_VALUE = "false";
|
||||
public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
@ -20,6 +22,7 @@ public class SlimFrameworkServerOptionsProvider implements OptionsProvider {
|
||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||
return builder.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||
.put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE)
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,8 @@ public class StaticDocOptionsProvider implements OptionsProvider {
|
||||
public static final String INVOKER_PACKAGE_VALUE = "io.swagger.client.test";
|
||||
public static final String GROUP_ID_VALUE = "io.swagger.test";
|
||||
public static final String ARTIFACT_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
@ -28,6 +30,7 @@ public class StaticDocOptionsProvider implements OptionsProvider {
|
||||
.put(CodegenConstants.GROUP_ID, GROUP_ID_VALUE)
|
||||
.put(CodegenConstants.ARTIFACT_ID, ARTIFACT_ID_VALUE)
|
||||
.put(CodegenConstants.ARTIFACT_VERSION, ARTIFACT_VERSION_VALUE)
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,8 @@ public class StaticHtmlOptionsProvider implements OptionsProvider {
|
||||
public static final String INVOKER_PACKAGE_VALUE = "io.swagger.client.test";
|
||||
public static final String GROUP_ID_VALUE = "io.swagger.test";
|
||||
public static final String ARTIFACT_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
@ -34,6 +36,7 @@ public class StaticHtmlOptionsProvider implements OptionsProvider {
|
||||
.put(CodegenConstants.GROUP_ID, GROUP_ID_VALUE)
|
||||
.put(CodegenConstants.ARTIFACT_ID, ARTIFACT_ID_VALUE)
|
||||
.put(CodegenConstants.ARTIFACT_VERSION, ARTIFACT_VERSION_VALUE)
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,8 @@ import java.util.Map;
|
||||
public class SwaggerOptionsProvider implements OptionsProvider {
|
||||
public static final String SORT_PARAMS_VALUE = "false";
|
||||
public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
@ -20,6 +22,7 @@ public class SwaggerOptionsProvider implements OptionsProvider {
|
||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||
return builder.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||
.put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE)
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@ import java.util.Map;
|
||||
public class SwaggerYamlOptionsProvider implements OptionsProvider {
|
||||
public static final String SORT_PARAMS_VALUE = "false";
|
||||
public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
@ -21,6 +22,7 @@ public class SwaggerYamlOptionsProvider implements OptionsProvider {
|
||||
return builder.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||
.put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE)
|
||||
.put("outputFile", "swagger.yaml")
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,7 @@ public class Swift3OptionsProvider implements OptionsProvider {
|
||||
public static final String POD_SCREENSHOTS_VALUE = "podScreenshots";
|
||||
public static final String POD_DOCUMENTATION_URL_VALUE = "podDocumentationURL";
|
||||
public static final String SWIFT_USE_API_NAMESPACE_VALUE = "swiftUseApiNamespace";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
@ -53,6 +54,7 @@ public class Swift3OptionsProvider implements OptionsProvider {
|
||||
.put(Swift3Codegen.POD_DOCUMENTATION_URL, POD_DOCUMENTATION_URL_VALUE)
|
||||
.put(Swift3Codegen.SWIFT_USE_API_NAMESPACE, SWIFT_USE_API_NAMESPACE_VALUE)
|
||||
.put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true")
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,8 @@ public class SwiftOptionsProvider implements OptionsProvider {
|
||||
public static final String POD_SCREENSHOTS_VALUE = "podScreenshots";
|
||||
public static final String POD_DOCUMENTATION_URL_VALUE = "podDocumentationURL";
|
||||
public static final String SWIFT_USE_API_NAMESPACE_VALUE = "swiftUseApiNamespace";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
@ -53,6 +55,7 @@ public class SwiftOptionsProvider implements OptionsProvider {
|
||||
.put(SwiftCodegen.POD_DOCUMENTATION_URL, POD_DOCUMENTATION_URL_VALUE)
|
||||
.put(SwiftCodegen.SWIFT_USE_API_NAMESPACE, SWIFT_USE_API_NAMESPACE_VALUE)
|
||||
.put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true")
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,8 @@ import java.util.Map;
|
||||
public class TizenClientOptionsProvider implements OptionsProvider {
|
||||
public static final String SORT_PARAMS_VALUE = "false";
|
||||
public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
@ -20,6 +22,7 @@ public class TizenClientOptionsProvider implements OptionsProvider {
|
||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||
return builder.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||
.put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE)
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -15,6 +15,8 @@ public class TypeScriptAngular2ClientOptionsProvider implements OptionsProvider
|
||||
private static final String NMP_NAME = "npmName";
|
||||
private static final String NMP_VERSION = "1.1.2";
|
||||
private static final String NPM_REPOSITORY = "https://registry.npmjs.org";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
@ -32,6 +34,7 @@ public class TypeScriptAngular2ClientOptionsProvider implements OptionsProvider
|
||||
.put(TypeScriptAngular2ClientCodegen.NPM_VERSION, NMP_VERSION)
|
||||
.put(TypeScriptAngular2ClientCodegen.SNAPSHOT, Boolean.FALSE.toString())
|
||||
.put(TypeScriptAngular2ClientCodegen.NPM_REPOSITORY, NPM_REPOSITORY)
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,8 @@ public class TypeScriptAngularClientOptionsProvider implements OptionsProvider {
|
||||
public static final String SORT_PARAMS_VALUE = "false";
|
||||
public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true";
|
||||
public static final String MODEL_PROPERTY_NAMING_VALUE = "camelCase";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
@ -24,6 +26,7 @@ public class TypeScriptAngularClientOptionsProvider implements OptionsProvider {
|
||||
.put(CodegenConstants.SUPPORTS_ES6, SUPPORTS_ES6_VALUE)
|
||||
.put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE)
|
||||
.put(CodegenConstants.MODEL_PROPERTY_NAMING, MODEL_PROPERTY_NAMING_VALUE)
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,8 @@ public class TypeScriptFetchClientOptionsProvider implements OptionsProvider {
|
||||
public static final String MODEL_PROPERTY_NAMING_VALUE = "camelCase";
|
||||
private static final String NMP_NAME = "npmName";
|
||||
private static final String NMP_VERSION = "1.0.0";
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
@ -28,6 +30,7 @@ public class TypeScriptFetchClientOptionsProvider implements OptionsProvider {
|
||||
.put(CodegenConstants.SUPPORTS_ES6, String.valueOf(SUPPORTS_ES6_VALUE))
|
||||
.put(TypeScriptFetchClientCodegen.NPM_NAME, NMP_NAME)
|
||||
.put(TypeScriptFetchClientCodegen.NPM_VERSION, NMP_VERSION)
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,8 @@ public class TypeScriptNodeClientOptionsProvider implements OptionsProvider {
|
||||
private static final String NMP_VERSION = "1.1.2";
|
||||
private static final String NPM_REPOSITORY = "https://registry.npmjs.org";
|
||||
|
||||
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
return "typescript-node";
|
||||
@ -34,6 +36,7 @@ public class TypeScriptNodeClientOptionsProvider implements OptionsProvider {
|
||||
.put(TypeScriptAngular2ClientCodegen.NPM_VERSION, NMP_VERSION)
|
||||
.put(TypeScriptAngular2ClientCodegen.SNAPSHOT, Boolean.FALSE.toString())
|
||||
.put(TypeScriptAngular2ClientCodegen.NPM_REPOSITORY, NPM_REPOSITORY)
|
||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user