Skip to content

Commit

Permalink
Fix for complex properties on definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
abelsilva committed May 9, 2016
1 parent 2071e7a commit 3339497
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/SwaggerWcf/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.1.7")]
[assembly: AssemblyFileVersion("0.1.7")]
[assembly: AssemblyInformationalVersion("0.1.7")]
[assembly: AssemblyVersion("0.1.8")]
[assembly: AssemblyFileVersion("0.1.8")]
[assembly: AssemblyInformationalVersion("0.1.8")]
8 changes: 7 additions & 1 deletion src/SwaggerWcf/Support/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,19 @@ public static TypeFormat MapSwaggerType(Type type, IList<Type> definitions)
{
return new TypeFormat(ParameterType.String, "enum");
}

//it's a collection/array, so it will use the swagger "container" syntax
if (type.GetInterfaces().Any(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IEnumerable<>)))
{
return new TypeFormat(ParameterType.Array, null);
}

//it's a collection/array, so it will use the swagger "container" syntax
if (type.GetInterfaces().Any(i => i == typeof(System.Collections.IEnumerable)))
{
return new TypeFormat(ParameterType.Array, null);
}

//it's a complex type, so we'll need to map it later
if (definitions != null && !definitions.Contains(type))
{
Expand Down

0 comments on commit 3339497

Please sign in to comment.