Skip to content

Commit

Permalink
Solve issue with missing import for array model
Browse files Browse the repository at this point in the history
  • Loading branch information
jirikuncar committed Jun 4, 2020
1 parent a7dbe80 commit b2ca2f7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ public Map<String, Object> postProcessAllModels(Map<String, Object> objs) {
CodegenProperty modelProperty = fromProperty("value", modelSchema);

if (cm.isEnum || cm.isAlias) {
if (!modelProperty.isEnum && !modelProperty.hasValidation) {
if (!modelProperty.isEnum && !modelProperty.hasValidation && !cm.isArrayModel) {
// remove these models because they are aliases and do not have any enums or validations
modelSchemasToRemove.put(cm.name, modelSchema);
}
Expand Down Expand Up @@ -833,7 +833,7 @@ public CodegenModel fromModel(String name, Schema schema) {
if (modelProperty.isEnum == true || modelProperty.hasValidation == true || result.isArrayModel) {
// these models are non-object models with enums and/or validations
// add a single property to the model so we can have a way to access validations
result.isAlias = !result.isArrayModel;
result.isAlias = true;
modelProperty.required = true;
List<CodegenProperty> theProperties = Arrays.asList(modelProperty);
result.setAllVars(theProperties);
Expand Down

0 comments on commit b2ca2f7

Please sign in to comment.