forked from loafle/openapi-generator-original
NancyFx:
- Fixed typo
This commit is contained in:
@@ -38,7 +38,7 @@ public class CodegenModel {
|
||||
public Set<String> allMandatory;
|
||||
|
||||
public Set<String> imports = new TreeSet<String>();
|
||||
public Boolean hasVars, emptyVars, hasMoreModels, hasEnums, isEnum, hasRequired, isArrayModel, hasChildrens;
|
||||
public Boolean hasVars, emptyVars, hasMoreModels, hasEnums, isEnum, hasRequired, isArrayModel, hasChildren;
|
||||
public ExternalDocs externalDocs;
|
||||
|
||||
public Map<String, Object> vendorExtensions;
|
||||
@@ -123,7 +123,7 @@ public class CodegenModel {
|
||||
return false;
|
||||
if (externalDocs != null ? !externalDocs.equals(that.externalDocs) : that.externalDocs != null)
|
||||
return false;
|
||||
if (!Objects.equals(hasChildrens, that.hasChildrens))
|
||||
if (!Objects.equals(hasChildren, that.hasChildren))
|
||||
return false;
|
||||
if (!Objects.equals(parentVars, that.parentVars))
|
||||
return false;
|
||||
@@ -163,7 +163,7 @@ public class CodegenModel {
|
||||
result = 31 * result + (isEnum != null ? isEnum.hashCode() : 0);
|
||||
result = 31 * result + (externalDocs != null ? externalDocs.hashCode() : 0);
|
||||
result = 31 * result + (vendorExtensions != null ? vendorExtensions.hashCode() : 0);
|
||||
result = 31 * result + Objects.hash(hasChildrens);
|
||||
result = 31 * result + Objects.hash(hasChildren);
|
||||
result = 31 * result + Objects.hash(parentVars);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class NancyFXServerCodegen extends AbstractCSharpCodegen {
|
||||
|
||||
private final Map<String, DependencyInfo> dependencies = new HashMap<>();
|
||||
private final Set<String> parentModels = new HashSet<>();
|
||||
private final Multimap<String, CodegenModel> children = ArrayListMultimap.create();
|
||||
private final Multimap<String, CodegenModel> childrenByParent = ArrayListMultimap.create();
|
||||
private final BiMap<String, String> modelNameMapping = HashBiMap.create();
|
||||
|
||||
public NancyFXServerCodegen() {
|
||||
@@ -225,9 +225,9 @@ public class NancyFXServerCodegen extends AbstractCSharpCodegen {
|
||||
log.info("Processing parents: " + parentModels);
|
||||
for (final String parent : parentModels) {
|
||||
final CodegenModel parentModel = modelByName(parent, models);
|
||||
parentModel.hasChildrens = true;
|
||||
final Collection<CodegenModel> childrens = children.get(parent);
|
||||
for (final CodegenModel child : childrens) {
|
||||
parentModel.hasChildren = true;
|
||||
final Collection<CodegenModel> childrenModels = childrenByParent.get(parent);
|
||||
for (final CodegenModel child : childrenModels) {
|
||||
processParentPropertiesInChildModel(parentModel, child);
|
||||
}
|
||||
}
|
||||
@@ -282,8 +282,8 @@ public class NancyFXServerCodegen extends AbstractCSharpCodegen {
|
||||
super.postProcessModelProperty(model, property);
|
||||
if (!isNullOrEmpty(model.parent)) {
|
||||
parentModels.add(model.parent);
|
||||
if (!children.containsEntry(model.parent, model)) {
|
||||
children.put(model.parent, model);
|
||||
if (!childrenByParent.containsEntry(model.parent, model)) {
|
||||
childrenByParent.put(model.parent, model);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user