forked from loafle/openapi-generator-original
add option to support ES6
This commit is contained in:
@@ -8,6 +8,7 @@ import io.swagger.codegen.CodegenConstants;
|
||||
import io.swagger.codegen.languages.TypeScriptAngular2ClientCodegen;
|
||||
|
||||
public class TypeScriptAngular2ClientOptionsProvider implements OptionsProvider {
|
||||
public static final String SUPPORTS_ES6_VALUE = "false";
|
||||
public static final String SORT_PARAMS_VALUE = "false";
|
||||
public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true";
|
||||
private static final String MODEL_PROPERTY_NAMING_VALUE = "camelCase";
|
||||
@@ -26,6 +27,7 @@ public class TypeScriptAngular2ClientOptionsProvider implements OptionsProvider
|
||||
return builder.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||
.put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE)
|
||||
.put(CodegenConstants.MODEL_PROPERTY_NAMING, MODEL_PROPERTY_NAMING_VALUE)
|
||||
.put(CodegenConstants.SUPPORTS_ES6, SUPPORTS_ES6_VALUE)
|
||||
.put(TypeScriptAngular2ClientCodegen.NPM_NAME, NMP_NAME)
|
||||
.put(TypeScriptAngular2ClientCodegen.NPM_VERSION, NMP_VERSION)
|
||||
.put(TypeScriptAngular2ClientCodegen.SNAPSHOT, Boolean.FALSE.toString())
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.google.common.collect.ImmutableMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class TypeScriptAngularClientOptionsProvider implements OptionsProvider {
|
||||
public static final String SUPPORTS_ES6_VALUE = "false";
|
||||
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";
|
||||
@@ -20,6 +21,7 @@ public class TypeScriptAngularClientOptionsProvider implements OptionsProvider {
|
||||
public Map<String, String> createOptions() {
|
||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||
return builder.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||
.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)
|
||||
.build();
|
||||
|
||||
@@ -9,6 +9,7 @@ import io.swagger.codegen.languages.TypeScriptAngular2ClientCodegen;
|
||||
|
||||
|
||||
public class TypeScriptNodeClientOptionsProvider implements OptionsProvider {
|
||||
public static final String SUPPORTS_ES6_VALUE = "false";
|
||||
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";
|
||||
@@ -26,6 +27,7 @@ public class TypeScriptNodeClientOptionsProvider implements OptionsProvider {
|
||||
public Map<String, String> createOptions() {
|
||||
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
|
||||
return builder.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||
.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(TypeScriptAngular2ClientCodegen.NPM_NAME, NMP_NAME)
|
||||
|
||||
@@ -30,6 +30,8 @@ public class TypeScriptAngularClientOptionsTest extends AbstractOptionsTest {
|
||||
times = 1;
|
||||
clientCodegen.setModelPropertyNaming(TypeScriptAngularClientOptionsProvider.MODEL_PROPERTY_NAMING_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setSupportsES6(Boolean.valueOf(TypeScriptAngularClientOptionsProvider.SUPPORTS_ES6_VALUE));
|
||||
times = 1;
|
||||
}};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,8 @@ public class TypeScriptAngular2ClientOptionsTest extends AbstractOptionsTest {
|
||||
times = 1;
|
||||
clientCodegen.setModelPropertyNaming(TypeScriptAngularClientOptionsProvider.MODEL_PROPERTY_NAMING_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setSupportsES6(Boolean.valueOf(TypeScriptAngularClientOptionsProvider.SUPPORTS_ES6_VALUE));
|
||||
times = 1;
|
||||
}};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,8 @@ public class TypeScriptNodeClientOptionsTest extends AbstractOptionsTest {
|
||||
times = 1;
|
||||
clientCodegen.setModelPropertyNaming(TypeScriptNodeClientOptionsProvider.MODEL_PROPERTY_NAMING_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setSupportsES6(Boolean.valueOf(TypeScriptNodeClientOptionsProvider.SUPPORTS_ES6_VALUE));
|
||||
times = 1;
|
||||
}};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user