private static string GetTypeName(Type type, ITypeList duplicateTypes) { duplicateTypes.Add(type); if (TypeHelper.IsDictionary(type, out var keyType, out var valueType)) { if (!duplicateTypes.Contains(keyType) && !duplicateTypes.Contains(valueType)) { return($"{{{GetTypeName(keyType, duplicateTypes)}:{GetTypeName(valueType, duplicateTypes)}}}"); } }