add enum class support, merged test cases for php

This commit is contained in:
wing328
2016-06-26 17:41:29 +08:00
parent 5095fe1018
commit 74239c422b
60 changed files with 3511 additions and 618 deletions

View File

@@ -45,6 +45,7 @@ public class CodegenProperty implements Cloneable {
public Map<String, Object> vendorExtensions;
public Boolean hasValidation; // true if pattern, maximum, etc are set (only used in the mustache template)
public Boolean isInherited;
public String nameInCamelCase; // property name in camel case
@Override
public String toString() {
@@ -108,6 +109,7 @@ public class CodegenProperty implements Cloneable {
result = prime * result + ((isMapContainer == null) ? 0 : isMapContainer.hashCode());
result = prime * result + ((isListContainer == null) ? 0 : isListContainer.hashCode());
result = prime * result + Objects.hashCode(isInherited);
result = prime * result + Objects.hashCode(nameInCamelCase);
return result;
}
@@ -262,6 +264,9 @@ public class CodegenProperty implements Cloneable {
if (!Objects.equals(this.isInherited, other.isInherited)) {
return false;
}
if (!Objects.equals(this.nameInCamelCase, other.nameInCamelCase)) {
return false;
}
return true;
}

View File

@@ -1296,6 +1296,7 @@ public class DefaultCodegen {
property.name = toVarName(name);
property.baseName = name;
property.nameInCamelCase = camelize(name, false);
property.description = escapeText(p.getDescription());
property.unescapedDescription = p.getDescription();
property.getter = "get" + getterAndSetterCapitalize(name);