forked from loafle/openapi-generator-original
Replace tab with 4 space in Java files (#5298)
* replace tab with 4 space in java files * revise error message in shell script * print result before checking * revise grep expression
This commit is contained in:
@@ -34,49 +34,49 @@ public class CodegenParameter {
|
||||
*/
|
||||
public boolean required;
|
||||
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor17.
|
||||
*/
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor17.
|
||||
*/
|
||||
public String maximum;
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor17
|
||||
*/
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor17
|
||||
*/
|
||||
public boolean exclusiveMaximum;
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor21
|
||||
*/
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor21
|
||||
*/
|
||||
public String minimum;
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor21
|
||||
*/
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor21
|
||||
*/
|
||||
public boolean exclusiveMinimum;
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor26
|
||||
*/
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor26
|
||||
*/
|
||||
public Integer maxLength;
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor29
|
||||
*/
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor29
|
||||
*/
|
||||
public Integer minLength;
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor33
|
||||
*/
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor33
|
||||
*/
|
||||
public String pattern;
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor42
|
||||
*/
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor42
|
||||
*/
|
||||
public Integer maxItems;
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor45
|
||||
*/
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor45
|
||||
*/
|
||||
public Integer minItems;
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor49
|
||||
*/
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor49
|
||||
*/
|
||||
public boolean uniqueItems;
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor14
|
||||
*/
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor14
|
||||
*/
|
||||
public Number multipleOf;
|
||||
|
||||
public CodegenParameter copy() {
|
||||
|
||||
@@ -306,8 +306,8 @@ public class CodegenProperty implements Cloneable {
|
||||
@Override
|
||||
public CodegenProperty clone() {
|
||||
try {
|
||||
CodegenProperty cp = (CodegenProperty) super.clone();
|
||||
if (this._enum != null) {
|
||||
CodegenProperty cp = (CodegenProperty) super.clone();
|
||||
if (this._enum != null) {
|
||||
cp._enum = new ArrayList<String>(this._enum);
|
||||
}
|
||||
if (this.allowableValues != null) {
|
||||
@@ -316,10 +316,10 @@ public class CodegenProperty implements Cloneable {
|
||||
if (this.items != null) {
|
||||
cp.items = this.items;
|
||||
}
|
||||
if(this.vendorExtensions != null){
|
||||
if(this.vendorExtensions != null){
|
||||
cp.vendorExtensions = new HashMap<String, Object>(this.vendorExtensions);
|
||||
}
|
||||
return cp;
|
||||
return cp;
|
||||
} catch (CloneNotSupportedException e) {
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import config.ConfigParser;
|
||||
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
|
||||
|
||||
public class AuthParser {
|
||||
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(AuthParser.class);
|
||||
|
||||
public static List<AuthorizationValue> parse(String urlEncodedAuthStr) {
|
||||
@@ -25,7 +25,8 @@ public class AuthParser {
|
||||
for (String part : parts) {
|
||||
String[] kvPair = part.split(":");
|
||||
if (kvPair.length == 2) {
|
||||
auths.add(new AuthorizationValue(URLDecoder.decode(kvPair[0]), URLDecoder.decode(kvPair[1]), "header")); // FIXME replace the deprecated method by decode(string, encoding). Which encoding is used ? Default UTF-8 ?
|
||||
// FIXME replace the deprecated method by decode(string, encoding). Which encoding is used ? Default UTF-8 ?
|
||||
auths.add(new AuthorizationValue(URLDecoder.decode(kvPair[0]), URLDecoder.decode(kvPair[1]), "header"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -53,5 +54,4 @@ public class AuthParser {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -614,24 +614,24 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
||||
}
|
||||
|
||||
public void setPackageTitle(String packageTitle) {
|
||||
this.packageTitle = packageTitle;
|
||||
}
|
||||
this.packageTitle = packageTitle;
|
||||
}
|
||||
|
||||
public void setPackageProductName(String packageProductName) {
|
||||
this.packageProductName = packageProductName;
|
||||
}
|
||||
this.packageProductName = packageProductName;
|
||||
}
|
||||
|
||||
public void setPackageDescription(String packageDescription) {
|
||||
this.packageDescription = packageDescription;
|
||||
}
|
||||
|
||||
public void setPackageDescription(String packageDescription) {
|
||||
this.packageDescription = packageDescription;
|
||||
}
|
||||
|
||||
public void setPackageCompany(String packageCompany) {
|
||||
this.packageCompany = packageCompany;
|
||||
}
|
||||
this.packageCompany = packageCompany;
|
||||
}
|
||||
|
||||
public void setPackageCopyright(String packageCopyright) {
|
||||
this.packageCopyright = packageCopyright;
|
||||
}
|
||||
this.packageCopyright = packageCopyright;
|
||||
}
|
||||
|
||||
public void setSourceFolder(String sourceFolder) {
|
||||
this.sourceFolder = sourceFolder;
|
||||
|
||||
@@ -425,7 +425,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
|
||||
@Override
|
||||
public Map<String, Object> postProcessModels(Map<String, Object> objMap) {
|
||||
return super.postProcessModels(objMap);
|
||||
return super.postProcessModels(objMap);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,39 +8,39 @@ import io.swagger.models.properties.Property;
|
||||
|
||||
public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCodegen {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "typescript-angular";
|
||||
}
|
||||
@Override
|
||||
public String getName() {
|
||||
return "typescript-angular";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp() {
|
||||
return "Generates a TypeScript AngularJS client library.";
|
||||
}
|
||||
@Override
|
||||
public String getHelp() {
|
||||
return "Generates a TypeScript AngularJS client library.";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processOpts() {
|
||||
super.processOpts();
|
||||
supportingFiles.add(new SupportingFile("models.mustache", modelPackage().replace('.', File.separatorChar), "models.ts"));
|
||||
@Override
|
||||
public void processOpts() {
|
||||
super.processOpts();
|
||||
supportingFiles.add(new SupportingFile("models.mustache", modelPackage().replace('.', File.separatorChar), "models.ts"));
|
||||
supportingFiles.add(new SupportingFile("apis.mustache", apiPackage().replace('.', File.separatorChar), "api.ts"));
|
||||
supportingFiles.add(new SupportingFile("index.mustache", getIndexDirectory(), "index.ts"));
|
||||
supportingFiles.add(new SupportingFile("api.module.mustache", getIndexDirectory(), "api.module.ts"));
|
||||
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||
supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore"));
|
||||
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||
supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore"));
|
||||
|
||||
}
|
||||
|
||||
public TypeScriptAngularClientCodegen() {
|
||||
super();
|
||||
outputFolder = "generated-code/typescript-angular";
|
||||
modelTemplateFiles.put("model.mustache", ".ts");
|
||||
}
|
||||
|
||||
public TypeScriptAngularClientCodegen() {
|
||||
super();
|
||||
outputFolder = "generated-code/typescript-angular";
|
||||
modelTemplateFiles.put("model.mustache", ".ts");
|
||||
apiTemplateFiles.put("api.mustache", ".ts");
|
||||
embeddedTemplateDir = templateDir = "typescript-angular";
|
||||
apiPackage = "api";
|
||||
embeddedTemplateDir = templateDir = "typescript-angular";
|
||||
apiPackage = "api";
|
||||
modelPackage = "model";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public String getSwaggerType(Property p) {
|
||||
String swaggerType = super.getSwaggerType(p);
|
||||
if(isLanguagePrimitive(swaggerType) || isLanguageGenericType(swaggerType)) {
|
||||
@@ -49,18 +49,18 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode
|
||||
return addModelPrefix(swaggerType);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void postProcessParameter(CodegenParameter parameter) {
|
||||
super.postProcessParameter(parameter);
|
||||
parameter.dataType = addModelPrefix(parameter.dataType);
|
||||
}
|
||||
|
||||
private String getIndexDirectory() {
|
||||
private String getIndexDirectory() {
|
||||
String indexPackage = modelPackage.substring(0, Math.max(0, modelPackage.lastIndexOf('.')));
|
||||
return indexPackage.replace('.', File.separatorChar);
|
||||
}
|
||||
|
||||
private String addModelPrefix(String swaggerType) {
|
||||
private String addModelPrefix(String swaggerType) {
|
||||
String type = null;
|
||||
if (typeMapping.containsKey(swaggerType)) {
|
||||
type = typeMapping.get(swaggerType);
|
||||
@@ -74,7 +74,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode
|
||||
return type;
|
||||
}
|
||||
|
||||
private boolean isLanguagePrimitive(String type) {
|
||||
private boolean isLanguagePrimitive(String type) {
|
||||
return languageSpecificPrimitives.contains(type);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user