Skip to content

Commit

Permalink
allModels to LinkedHaskMap
Browse files Browse the repository at this point in the history
  • Loading branch information
Yilinwang authored and Wang committed Nov 17, 2020
1 parent e14ffd4 commit 7db6dbd
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ protected Map<String, Schema> getModelNameToSchemaCache() {
* @return map of all models indexed by names
*/
public Map<String, CodegenModel> getAllModels(Map<String, Object> objs) {
Map<String, CodegenModel> allModels = new HashMap<String, CodegenModel>();
Map<String, CodegenModel> allModels = new LinkedHashMap<String, CodegenModel>();
for (Entry<String, Object> entry : objs.entrySet()) {
String modelName = toModelName(entry.getKey());
Map<String, Object> inner = (Map<String, Object>) entry.getValue();
Expand Down Expand Up @@ -513,8 +513,7 @@ public Map<String, Object> updateAllModels(Map<String, Object> objs) {
}

// Let parent know about all its children
Map<String, CodegenModel> orderedAllModels = new LinkedHashMap<String, CodegenModel>(allModels);
for (String name : orderedAllModels.keySet()) {
for (String name : allModels.keySet()) {
CodegenModel cm = allModels.get(name);
CodegenModel parent = allModels.get(cm.getParent());
// if a discriminator exists on the parent, don't add this child to the inheritance hierarchy
Expand Down

0 comments on commit 7db6dbd

Please sign in to comment.