mirror of
https://github.com/jlengrand/openapi-generator.git
synced 2026-05-16 08:31:26 +00:00
NancyFx:
- Changed enum class name format - CodegenProperty parent and parentClass replaced by Booolen flag isInherited
This commit is contained in:
@@ -44,8 +44,7 @@ public class CodegenProperty implements Cloneable {
|
||||
public CodegenProperty items;
|
||||
public Map<String, Object> vendorExtensions;
|
||||
public Boolean hasValidation; // true if pattern, maximum, etc are set (only used in the mustache template)
|
||||
public String parent;
|
||||
public String parentClass;
|
||||
public Boolean isInherited;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
@@ -108,8 +107,7 @@ public class CodegenProperty implements Cloneable {
|
||||
result = prime * result + ((isDateTime == null) ? 0 : isDateTime.hashCode());
|
||||
result = prime * result + ((isMapContainer == null) ? 0 : isMapContainer.hashCode());
|
||||
result = prime * result + ((isListContainer == null) ? 0 : isListContainer.hashCode());
|
||||
result = prime * result + Objects.hashCode(parent);
|
||||
result = prime * result + Objects.hashCode(parentClass);
|
||||
result = prime * result + Objects.hashCode(isInherited);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -261,10 +259,7 @@ public class CodegenProperty implements Cloneable {
|
||||
if (this.isMapContainer != other.isMapContainer && (this.isMapContainer == null || !this.isMapContainer.equals(other.isMapContainer))) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(this.parent, other.parent)) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(this.parentClass, other.parentClass)) {
|
||||
if (!Objects.equals(this.isInherited, other.isInherited)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -264,9 +264,7 @@ public class NancyFXServerCodegen extends AbstractCSharpCodegen {
|
||||
if (duplicatedByParent != null) {
|
||||
log.info(String.format("Property: '%s' in '%s' model is inherited from '%s'" ,
|
||||
property.name, child.classname, parent.classname));
|
||||
duplicatedByParent.parent = parent.name;
|
||||
duplicatedByParent.parentClass = parent.classname;
|
||||
|
||||
duplicatedByParent.isInherited = true;
|
||||
final CodegenProperty parentVar = duplicatedByParent.clone();
|
||||
parentVar.hasMore = false;
|
||||
child.parentVars.add(parentVar);
|
||||
@@ -354,7 +352,7 @@ public class NancyFXServerCodegen extends AbstractCSharpCodegen {
|
||||
|
||||
@Override
|
||||
public String toEnumName(final CodegenProperty property) {
|
||||
return sanitizeName(camelize(property.name));
|
||||
return sanitizeName(camelize(property.name)) + "Enum";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user