Fix child expansion context creation, because currently it modifies the parent expansion context's seenTypes collections,
this cause problems with parameters like:
class SomeFilter {
LongFilter id;
LongFilter user;
}
In this case, the user field was not expanded.
@@ -73,7 +73,8 @@ public class ExpansionContext {
String parentName,
ResolvedType paramType,
DocumentationContext documentationContext) {
- seenTypes.add(paramType);
- return new ExpansionContext(parentName, paramType, documentationContext, seenTypes);
+ Set<ResolvedType> childSeenTypes = newHashSet(seenTypes);
+ childSeenTypes.add(paramType);
+ return new ExpansionContext(parentName, paramType, documentationContext, childSeenTypes);
}
}
