Source:
public static boolean maybeAddParameterTypeToModels(ControllerDocumentation controllerDocumentation, ResolvedType parameterType, String dataType, boolean isReturnType) { if (isPrimitive(parameterType.getErasedType())) { return false; } ResolvedTypeMemberSource member = new ResolvedTypeMemberSource(parameterType); if (parameterType.isArray()) { ResolvedArrayType arrayType = (ResolvedArrayType) parameterType; String componentType = modelName(arrayType.getArrayElementType()); if (!isPrimitive(arrayType.getArrayElementType().getErasedType())) { controllerDocumentation.putModel(componentType, new Model(String.format("Array[%s]", componentType), arrayType.getArrayElementType(), isReturnType)); return true; } } else if (ResolvedCollection.isList(member)) { ResolvedType elementType = ResolvedCollection.listElementType(member); String componentType = modelName(elementType); if (!isPrimitive(elementType.getErasedType())) { controllerDocumentation.putModel(componentType, new Model(String.format("List[%s]", componentType), elementType, isReturnType)); return true; } } else if (ResolvedCollection.isSet(member)) { ResolvedType elementType = ResolvedCollection.setElementType(member); String componentType = modelName(elementType); if (!isPrimitive(elementType.getErasedType())) { controllerDocumentation.putModel(componentType, new Model(String.format("Set[%s]", componentType), elementType, isReturnType)); return true; } } else if (ResolvedCollection.isCollection(member)) { ResolvedType elementType = ResolvedCollection.collectionElementType(member); String componentType = modelName(elementType); if (!isPrimitive(elementType.getErasedType())) { controllerDocumentation.putModel(componentType, new Model(String.format("Collection[%s]", componentType), elementType, isReturnType)); return true; } } else { controllerDocumentation.putModel(dataType, new Model(dataType, parameterType, isReturnType)); return true; } return false; }

Target:
public static boolean maybeAddParameterTypeToModels(ControllerDocumentation controllerDocumentation, ResolvedType parameterType, String dataType, boolean isReturnType) { if (isPrimitive(parameterType.getErasedType())) { return false; } ResolvedTypeMemberSource member = new ResolvedTypeMemberSource(parameterType); if (parameterType.isArray()) { ResolvedArrayType arrayType = (ResolvedArrayType) parameterType; String componentType = modelName(arrayType.getArrayElementType()); if (!isPrimitive(arrayType.getArrayElementType().getErasedType())) { controllerDocumentation.putModel(componentType, new Model(String.format("Array[%s]", componentType), arrayType.getArrayElementType(), isReturnType)); return true; } } else if (ResolvedCollection.isList(member)) { ResolvedType elementType = ResolvedCollection.listElementType(member); String componentType = modelName(elementType); if (!isPrimitive(elementType.getErasedType())) { controllerDocumentation.putModel(componentType, new Model(String.format("List[%s]", componentType), elementType, isReturnType)); return true; } } else if (ResolvedCollection.isSet(member)) { ResolvedType elementType = ResolvedCollection.setElementType(member); String componentType = modelName(elementType); if (!isPrimitive(elementType.getErasedType())) { controllerDocumentation.putModel(componentType, new Model(String.format("Set[%s]", componentType), elementType, isReturnType)); return true; } } else { controllerDocumentation.putModel(dataType, new Model(dataType, parameterType, isReturnType)); return true; } return false; }