Skip to content

Commit 5465b24

Browse files
committed
Fixed bug with List imports.
1 parent 753a187 commit 5465b24

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

polyapi-maven-plugin/src/main/java/io/polyapi/plugin/model/property/ObjectPropertyType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ private Set<String> getImports(JsonNode node, String basePackage, String default
9696
.isPresent()) {
9797
return switch (Optional.ofNullable(node.get("type")).map(JsonNode::textValue).orElse("")) {
9898
case "array" ->
99-
Optional.ofNullable(getRefType(node, format("%s.", basePackage), type -> format("%s.%s", basePackage, getType(type, defaultType))))
99+
Optional.ofNullable(getRefType(node, format("%s.", basePackage), type -> getImports(type, basePackage, defaultType).stream().findFirst().orElse(null)))
100100
.map(Set::of)
101101
.orElseGet(Set::of);
102102
case "integer", "string", "number", "boolean" -> Set.of();

0 commit comments

Comments
 (0)