Skip to content

Commit

Permalink
fix bug for capability
Browse files Browse the repository at this point in the history
  • Loading branch information
lllyfeng committed Aug 16, 2024
1 parent 1122110 commit de24540
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;

public class YangYinParser {
static {
Expand Down Expand Up @@ -211,6 +212,7 @@ public static YangSchemaContext filter(@Nonnull YangSchemaContext schemaContext,
continue;
}
}

unMatchedModules.add(module);
}

Expand All @@ -222,6 +224,16 @@ public static YangSchemaContext filter(@Nonnull YangSchemaContext schemaContext,
schemaContext.addImportOnlyModule(importOnlyModule);
}

for (Module module : schemaContext.getModules()){
List<Module> dependencies = module.getDependencies();
for(Module dependency: dependencies){
Optional<Module> moduleOp = schemaContext.getModule(dependency.getModuleId());
if(!moduleOp.isPresent()){
schemaContext.addImportOnlyModule(dependency);
moduleSet.addImportOnlyModule(new YangModuleDescription(dependency.getModuleId()));
}
}
}

YangSchema yangSchema = schemaContext.getYangSchema();
if (yangSchema == null) {
Expand Down

0 comments on commit de24540

Please sign in to comment.