Skip to content

Commit

Permalink
fix model name when obtaining from get$ref
Browse files Browse the repository at this point in the history
  • Loading branch information
wing328 committed Apr 2, 2018
1 parent d40c28b commit d690f42
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Expand Up @@ -311,7 +311,7 @@ public String toDefaultValue(Schema p) {
}
return "std::vector<" + inner + ">()";
} else if (!StringUtils.isEmpty(p.get$ref())) { // model
return "new " + toModelName(p.get$ref()) + "()";
return "new " + toModelName(getSimpleRef(p.get$ref())) + "()";
}
return "nullptr";
}
Expand Down
Expand Up @@ -334,7 +334,7 @@ public String toDefaultValue(Schema p) {
}
// else
if (!StringUtils.isEmpty(p.get$ref())) {
return "new " + toModelName(p.get$ref()) + "()";
return "new " + toModelName(getSimpleRef(p.get$ref())) + "()";
}
return "NULL";
}
Expand Down
Expand Up @@ -326,7 +326,7 @@ public String toDefaultValue(Schema p) {
}
return "std::vector<" + inner + ">()";
} else if (!StringUtils.isEmpty(p.get$ref())) {
return "new " + toModelName(p.get$ref()) + "()";
return "new " + toModelName(getSimpleRef(p.get$ref())) + "()";
}
return "nullptr";
}
Expand Down
Expand Up @@ -313,7 +313,7 @@ public String toDefaultValue(Schema p) {
}
return "std::vector<" + inner + ">()";
} else if (!StringUtils.isEmpty(p.get$ref())) {
return "new " + toModelName(p.get$ref()) + "()";
return "new " + toModelName(getSimpleRef(p.get$ref())) + "()";
}
return "nullptr";
}
Expand Down
Expand Up @@ -214,7 +214,7 @@ public String toDefaultValue(Schema p) {
} else if (p instanceof ArraySchema) {
return "new std::list()";
} else if (!StringUtils.isEmpty(p.get$ref())) {
return "new " + toModelName(p.get$ref()) + "()";
return "new " + toModelName(getSimpleRef(p.get$ref())) + "()";
}
return "null";
}
Expand Down

0 comments on commit d690f42

Please sign in to comment.