Fixed expansion of recursive types
We dont expand collection item types we've already seen
(1827)
@@ -110,12 +110,13 @@ public class ModelAttributeParameterExpander {
if (Types.isBaseType(itemType) || enumTypeDeterminer.isEnum(itemType.getErasedType())) {
parameters.add(simpleFields(context.getParentName(), context.getDocumentationContext(), each));
} else {
- parameters.addAll(
- expand(
- context.childContext(
+ ExpansionContext childContext = context.childContext(
nestedParentName(context.getParentName(), each.getField()),
itemType,
- context.getDocumentationContext())));
+ context.getDocumentationContext());
+ if (!context.hasSeenType(itemType)) {
+ parameters.addAll(expand(childContext));
+ }
}
}
