Skip to content

Commit

Permalink
fix #105
Browse files Browse the repository at this point in the history
  • Loading branch information
abelsilva committed Oct 30, 2017
1 parent 7a423aa commit 543733c
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions src/SwaggerWcf/Support/Mapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -686,12 +686,25 @@ private Schema BuildSchema(Type type, string funcName, bool wrappedResponse, ILi
Type t = type.GetElementType() ?? GetEnumerableType(type);
if (t == null)
return null;
definitionsTypesList.Add(t);
return new Schema

TypeFormat arrayTypeFormat = Helpers.MapSwaggerType(t);
if (arrayTypeFormat.IsPrimitiveType)
{
TypeFormat = typeFormat,
Ref = HttpUtility.HtmlEncode(t.GetModelName())
};
return new Schema
{
TypeFormat = typeFormat,
ArrayTypeFormat = arrayTypeFormat
};
}
else
{
definitionsTypesList.Add(t);
return new Schema
{
TypeFormat = typeFormat,
Ref = HttpUtility.HtmlEncode(t.GetModelName())
};
}
default:
definitionsTypesList.Add(type);
return new Schema
Expand Down

0 comments on commit 543733c

Please sign in to comment.