Fixed a stackoverflow bug when generating a Rest Client and the object has it's type as a sub type. Bumped package versino to 1.7.5
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
<AssemblyName>MontoyaTech.Rest.Net</AssemblyName>
|
||||
<RootNamespace>MontoyaTech.Rest.Net</RootNamespace>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
<Version>1.7.4</Version>
|
||||
<Version>1.7.5</Version>
|
||||
<PackageReleaseNotes></PackageReleaseNotes>
|
||||
<PackageIcon>Logo_Symbol_Black_Outline.png</PackageIcon>
|
||||
</PropertyGroup>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.Design;
|
||||
@@ -69,11 +69,14 @@ namespace MontoyaTech.Rest.Net
|
||||
{
|
||||
foreach (var argument in arguments)
|
||||
{
|
||||
var types = this.FindTypeDependencies(argument);
|
||||
if (argument != type)
|
||||
{
|
||||
var types = this.FindTypeDependencies(argument);
|
||||
|
||||
for (int i = 0; i < types.Count; i++)
|
||||
if (!dependencies.Contains(types[i]))
|
||||
dependencies.Add(types[i]);
|
||||
for (int i = 0; i < types.Count; i++)
|
||||
if (!dependencies.Contains(types[i]))
|
||||
dependencies.Add(types[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +102,7 @@ namespace MontoyaTech.Rest.Net
|
||||
{
|
||||
foreach (var field in fields)
|
||||
{
|
||||
if (field.IsPublic && !field.IsSpecialName)
|
||||
if (field.IsPublic && !field.IsSpecialName && field.FieldType != type)
|
||||
{
|
||||
var types = this.FindTypeDependencies(field.FieldType);
|
||||
|
||||
@@ -116,7 +119,7 @@ namespace MontoyaTech.Rest.Net
|
||||
{
|
||||
foreach (var property in properties)
|
||||
{
|
||||
if (!property.IsSpecialName && property.GetSetMethod() != null && property.GetGetMethod() != null)
|
||||
if (!property.IsSpecialName && property.GetSetMethod() != null && property.GetGetMethod() != null && property.PropertyType != type)
|
||||
{
|
||||
var types = this.FindTypeDependencies(property.PropertyType);
|
||||
|
||||
|
Reference in New Issue
Block a user