forked from loafle/openapi-generator-original
more cleanup
This commit is contained in:
parent
8636efe493
commit
ce3bd1f79d
@ -272,9 +272,6 @@ public class CodegenConstants {
|
||||
public static final String HTTP_USER_AGENT = "httpUserAgent";
|
||||
public static final String HTTP_USER_AGENT_DESC = "HTTP user agent, e.g. codegen_csharp_api_client, default to 'OpenAPI-Generator/{packageVersion}/{language}'";
|
||||
|
||||
public static final String SUPPORTS_ES6 = "supportsES6";
|
||||
public static final String SUPPORTS_ES6_DESC = "Generate code that conforms to ES6.";
|
||||
|
||||
public static final String SUPPORTS_ASYNC = "supportsAsync";
|
||||
public static final String SUPPORTS_ASYNC_DESC = "Generate code that supports async operations.";
|
||||
|
||||
|
@ -25,7 +25,6 @@ import org.openapitools.codegen.languages.TypeScriptAngularClientCodegen;
|
||||
import java.util.Map;
|
||||
|
||||
public class TypeScriptAngularClientOptionsProvider implements OptionsProvider {
|
||||
public static final String SUPPORTS_ES6_VALUE = "false";
|
||||
public static final String NULL_SAFE_ADDITIONAL_PROPS_VALUE = "false";
|
||||
public static final String ENUM_NAME_SUFFIX = "Enum";
|
||||
public static final String STRING_ENUMS_VALUE = "false";
|
||||
@ -67,7 +66,6 @@ public class TypeScriptAngularClientOptionsProvider implements OptionsProvider {
|
||||
.put(CodegenConstants.ENUM_PROPERTY_NAMING, ENUM_PROPERTY_NAMING_VALUE)
|
||||
.put(CodegenConstants.MODEL_PROPERTY_NAMING, MODEL_PROPERTY_NAMING_VALUE)
|
||||
.put(CodegenConstants.PARAM_NAMING, PARAM_NAMING_VALUE)
|
||||
.put(CodegenConstants.SUPPORTS_ES6, SUPPORTS_ES6_VALUE)
|
||||
.put(AbstractTypeScriptClientCodegen.NULL_SAFE_ADDITIONAL_PROPS, NULL_SAFE_ADDITIONAL_PROPS_VALUE)
|
||||
.put(AbstractTypeScriptClientCodegen.ENUM_PROPERTY_NAMING_REPLACE_SPECIAL_CHAR, ENUM_PROPERTY_NAMING_REPLACE_SPECIAL_CHAR_VALUE)
|
||||
.put(CodegenConstants.ENUM_NAME_SUFFIX, ENUM_NAME_SUFFIX)
|
||||
|
@ -24,7 +24,6 @@ import org.openapitools.codegen.languages.AbstractTypeScriptClientCodegen;
|
||||
import java.util.Map;
|
||||
|
||||
public class TypeScriptAngularJsClientOptionsProvider implements OptionsProvider {
|
||||
public static final String SUPPORTS_ES6_VALUE = "false";
|
||||
public static final String NULL_SAFE_ADDITIONAL_PROPS_VALUE = "false";
|
||||
public static final String ENUM_NAME_SUFFIX = "Enum";
|
||||
public static final String SORT_PARAMS_VALUE = "false";
|
||||
@ -47,7 +46,6 @@ public class TypeScriptAngularJsClientOptionsProvider 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.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG, SORT_MODEL_PROPERTIES_VALUE)
|
||||
.put(CodegenConstants.SUPPORTS_ES6, SUPPORTS_ES6_VALUE)
|
||||
.put(AbstractTypeScriptClientCodegen.NULL_SAFE_ADDITIONAL_PROPS, NULL_SAFE_ADDITIONAL_PROPS_VALUE)
|
||||
.put(CodegenConstants.ENUM_NAME_SUFFIX, ENUM_NAME_SUFFIX)
|
||||
.put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE)
|
||||
|
@ -28,7 +28,6 @@ public class TypeScriptAureliaClientOptionsProvider implements OptionsProvider {
|
||||
public static final String SORT_PARAMS_VALUE = "false";
|
||||
public static final String SORT_MODEL_PROPERTIES_VALUE = "false";
|
||||
public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true";
|
||||
public static final Boolean SUPPORTS_ES6_VALUE = false;
|
||||
public static final Boolean NULL_SAFE_ADDITIONAL_PROPS_VALUE = false;
|
||||
public static final String ENUM_NAME_SUFFIX = "Enum";
|
||||
public static final String ENUM_PROPERTY_NAMING_VALUE = "PascalCase";
|
||||
@ -55,7 +54,6 @@ public class TypeScriptAureliaClientOptionsProvider implements OptionsProvider {
|
||||
.put(CodegenConstants.ENUM_PROPERTY_NAMING, ENUM_PROPERTY_NAMING_VALUE)
|
||||
.put(CodegenConstants.MODEL_PROPERTY_NAMING, MODEL_PROPERTY_NAMING_VALUE)
|
||||
.put(CodegenConstants.PARAM_NAMING, PARAM_NAMING_VALUE)
|
||||
.put(CodegenConstants.SUPPORTS_ES6, String.valueOf(SUPPORTS_ES6_VALUE))
|
||||
.put(AbstractTypeScriptClientCodegen.NULL_SAFE_ADDITIONAL_PROPS, String.valueOf(NULL_SAFE_ADDITIONAL_PROPS_VALUE))
|
||||
.put(AbstractTypeScriptClientCodegen.ENUM_PROPERTY_NAMING_REPLACE_SPECIAL_CHAR, ENUM_PROPERTY_NAMING_REPLACE_SPECIAL_CHAR_VALUE)
|
||||
.put(CodegenConstants.ENUM_NAME_SUFFIX, ENUM_NAME_SUFFIX)
|
||||
|
@ -28,7 +28,6 @@ public class TypeScriptFetchClientOptionsProvider implements OptionsProvider {
|
||||
public static final String SORT_PARAMS_VALUE = "false";
|
||||
public static final String SORT_MODEL_PROPERTIES_VALUE = "false";
|
||||
public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true";
|
||||
public static final Boolean SUPPORTS_ES6_VALUE = false;
|
||||
public static final String IMPORT_FILE_EXTENSION_VALUE = "";
|
||||
public static final Boolean NULL_SAFE_ADDITIONAL_PROPS_VALUE = false;
|
||||
public static final String ENUM_NAME_SUFFIX = "Enum";
|
||||
@ -60,7 +59,6 @@ public class TypeScriptFetchClientOptionsProvider implements OptionsProvider {
|
||||
.put(CodegenConstants.ENUM_PROPERTY_NAMING, ENUM_PROPERTY_NAMING_VALUE)
|
||||
.put(CodegenConstants.MODEL_PROPERTY_NAMING, MODEL_PROPERTY_NAMING_VALUE)
|
||||
.put(CodegenConstants.PARAM_NAMING, PARAM_NAMING_VALUE)
|
||||
.put(CodegenConstants.SUPPORTS_ES6, String.valueOf(SUPPORTS_ES6_VALUE))
|
||||
.put(AbstractTypeScriptClientCodegen.NULL_SAFE_ADDITIONAL_PROPS, String.valueOf(NULL_SAFE_ADDITIONAL_PROPS_VALUE))
|
||||
.put(AbstractTypeScriptClientCodegen.ENUM_PROPERTY_NAMING_REPLACE_SPECIAL_CHAR, ENUM_PROPERTY_NAMING_REPLACE_SPECIAL_CHAR_VALUE)
|
||||
.put(CodegenConstants.ENUM_NAME_SUFFIX, ENUM_NAME_SUFFIX)
|
||||
|
@ -24,7 +24,6 @@ import org.openapitools.codegen.languages.TypeScriptNestjsClientCodegen;
|
||||
import java.util.Map;
|
||||
|
||||
public class TypeScriptNestjsClientOptionsProvider implements OptionsProvider {
|
||||
public static final String SUPPORTS_ES6_VALUE = "false";
|
||||
public static final String NULL_SAFE_ADDITIONAL_PROPS_VALUE = "false";
|
||||
public static final String ENUM_NAME_SUFFIX = "Enum";
|
||||
public static final String STRING_ENUMS_VALUE = "false";
|
||||
@ -63,7 +62,6 @@ public class TypeScriptNestjsClientOptionsProvider implements OptionsProvider {
|
||||
.put(CodegenConstants.ENUM_PROPERTY_NAMING, ENUM_PROPERTY_NAMING_VALUE)
|
||||
.put(CodegenConstants.MODEL_PROPERTY_NAMING, MODEL_PROPERTY_NAMING_VALUE)
|
||||
.put(CodegenConstants.PARAM_NAMING, PARAM_NAMING_VALUE)
|
||||
.put(CodegenConstants.SUPPORTS_ES6, SUPPORTS_ES6_VALUE)
|
||||
.put(AbstractTypeScriptClientCodegen.NULL_SAFE_ADDITIONAL_PROPS, NULL_SAFE_ADDITIONAL_PROPS_VALUE)
|
||||
.put(AbstractTypeScriptClientCodegen.ENUM_PROPERTY_NAMING_REPLACE_SPECIAL_CHAR, ENUM_PROPERTY_NAMING_REPLACE_SPECIAL_CHAR_VALUE)
|
||||
.put(CodegenConstants.ENUM_NAME_SUFFIX, ENUM_NAME_SUFFIX)
|
||||
|
@ -26,7 +26,6 @@ import java.util.Map;
|
||||
|
||||
|
||||
public class TypeScriptNodeClientOptionsProvider implements OptionsProvider {
|
||||
public static final String SUPPORTS_ES6_VALUE = "false";
|
||||
public static final String NULL_SAFE_ADDITIONAL_PROPS_VALUE = "false";
|
||||
public static final String ENUM_NAME_SUFFIX = "Enum";
|
||||
public static final String SORT_PARAMS_VALUE = "false";
|
||||
@ -54,7 +53,6 @@ public class TypeScriptNodeClientOptionsProvider 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.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG, SORT_MODEL_PROPERTIES_VALUE)
|
||||
.put(CodegenConstants.SUPPORTS_ES6, SUPPORTS_ES6_VALUE)
|
||||
.put(AbstractTypeScriptClientCodegen.NULL_SAFE_ADDITIONAL_PROPS, NULL_SAFE_ADDITIONAL_PROPS_VALUE)
|
||||
.put(AbstractTypeScriptClientCodegen.ENUM_PROPERTY_NAMING_REPLACE_SPECIAL_CHAR, ENUM_PROPERTY_NAMING_REPLACE_SPECIAL_CHAR_VALUE)
|
||||
.put(CodegenConstants.ENUM_NAME_SUFFIX, ENUM_NAME_SUFFIX)
|
||||
|
@ -89,7 +89,6 @@ public class TypeScriptAxiosClientCodegenTest {
|
||||
codegen.additionalProperties().put("npmName", "@openapi/typescript-axios-petstore");
|
||||
codegen.additionalProperties().put("snapshot", false);
|
||||
codegen.additionalProperties().put("npmVersion", "1.0.0-SNAPSHOT");
|
||||
codegen.additionalProperties().put("supportsES6", true);
|
||||
|
||||
codegen.processOpts();
|
||||
|
||||
@ -97,18 +96,4 @@ public class TypeScriptAxiosClientCodegenTest {
|
||||
assertThat(codegen.supportingFiles()).contains(new SupportingFile("tsconfig.esm.mustache", "", "tsconfig.esm.json"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void doesNotContainESMTSConfigFileInCaseOfES5AndNPM() {
|
||||
TypeScriptAxiosClientCodegen codegen = new TypeScriptAxiosClientCodegen();
|
||||
|
||||
codegen.additionalProperties().put("npmName", "@openapi/typescript-axios-petstore");
|
||||
codegen.additionalProperties().put("snapshot", false);
|
||||
codegen.additionalProperties().put("npmVersion", "1.0.0-SNAPSHOT");
|
||||
codegen.additionalProperties().put("supportsES6", false);
|
||||
|
||||
codegen.processOpts();
|
||||
|
||||
assertThat(codegen.supportingFiles()).contains(new SupportingFile("tsconfig.mustache", "", "tsconfig.json"));
|
||||
assertThat(codegen.supportingFiles()).doesNotContain(new SupportingFile("tsconfig.esm.mustache", "", "tsconfig.esm.json"));
|
||||
}
|
||||
}
|
||||
|
@ -149,26 +149,10 @@ public class TypeScriptFetchClientCodegenTest {
|
||||
codegen.additionalProperties().put("npmName", "@openapi/typescript-fetch-petstore");
|
||||
codegen.additionalProperties().put("snapshot", false);
|
||||
codegen.additionalProperties().put("npmVersion", "1.0.0-SNAPSHOT");
|
||||
codegen.additionalProperties().put("supportsES6", true);
|
||||
|
||||
codegen.processOpts();
|
||||
|
||||
assertThat(codegen.supportingFiles()).contains(new SupportingFile("tsconfig.mustache", "", "tsconfig.json"));
|
||||
assertThat(codegen.supportingFiles()).contains(new SupportingFile("tsconfig.esm.mustache", "", "tsconfig.esm.json"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void doesNotContainESMTSConfigFileInCaseOfES5AndNPM() {
|
||||
TypeScriptFetchClientCodegen codegen = new TypeScriptFetchClientCodegen();
|
||||
|
||||
codegen.additionalProperties().put("npmName", "@openapi/typescript-fetch-petstore");
|
||||
codegen.additionalProperties().put("snapshot", false);
|
||||
codegen.additionalProperties().put("npmVersion", "1.0.0-SNAPSHOT");
|
||||
codegen.additionalProperties().put("supportsES6", false);
|
||||
|
||||
codegen.processOpts();
|
||||
|
||||
assertThat(codegen.supportingFiles()).contains(new SupportingFile("tsconfig.mustache", "", "tsconfig.json"));
|
||||
assertThat(codegen.supportingFiles()).doesNotContain(new SupportingFile("tsconfig.esm.mustache", "", "tsconfig.esm.json"));
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,6 @@ public class TypescriptNodeES5IntegrationTest extends AbstractIntegrationTest {
|
||||
properties.put("npmName", "node-es6-test");
|
||||
properties.put("npmVersion", "1.0.3");
|
||||
properties.put("snapshot", "false");
|
||||
properties.put("supportsES6", "false");
|
||||
|
||||
return properties;
|
||||
}
|
||||
|
@ -40,7 +40,6 @@ public class TypescriptNodeEnumIntegrationTest extends AbstractIntegrationTest {
|
||||
properties.put("npmName", "node-es6-test");
|
||||
properties.put("npmVersion", "1.0.3");
|
||||
properties.put("snapshot", "false");
|
||||
properties.put("supportsES6", "false");
|
||||
|
||||
return properties;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user