From 1acda731620fa5820bff57368b6492535f4356b5 Mon Sep 17 00:00:00 2001 From: Abel Silva Date: Sat, 14 Jan 2017 23:00:51 -0400 Subject: [PATCH] allow data classes to be used without DataContract/DataMember attributes - fixes #64 --- src/SwaggerWcf/Properties/AssemblyInfo.cs | 6 +++--- src/SwaggerWcf/Support/DefinitionsBuilder.cs | 3 +-- src/SwaggerWcf/SwaggerWcf.nuspec | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/SwaggerWcf/Properties/AssemblyInfo.cs b/src/SwaggerWcf/Properties/AssemblyInfo.cs index aafeb7b..baca1cd 100644 --- a/src/SwaggerWcf/Properties/AssemblyInfo.cs +++ b/src/SwaggerWcf/Properties/AssemblyInfo.cs @@ -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.20")] -[assembly: AssemblyFileVersion("0.1.20")] -[assembly: AssemblyInformationalVersion("0.1.20")] +[assembly: AssemblyVersion("0.1.21")] +[assembly: AssemblyFileVersion("0.1.21")] +[assembly: AssemblyInformationalVersion("0.1.21")] diff --git a/src/SwaggerWcf/Support/DefinitionsBuilder.cs b/src/SwaggerWcf/Support/DefinitionsBuilder.cs index bbf59af..7b3d10f 100644 --- a/src/SwaggerWcf/Support/DefinitionsBuilder.cs +++ b/src/SwaggerWcf/Support/DefinitionsBuilder.cs @@ -189,8 +189,7 @@ public static Type GetEnumerableType(Type type) private static DefinitionProperty ProcessProperty(PropertyInfo propertyInfo, IList hiddenTags, Stack typesStack) { - if (propertyInfo.GetCustomAttribute() == null - || propertyInfo.GetCustomAttribute() != null + if (propertyInfo.GetCustomAttribute() != null || propertyInfo.GetCustomAttributes() .Select(t => t.TagName) .Any(hiddenTags.Contains)) diff --git a/src/SwaggerWcf/SwaggerWcf.nuspec b/src/SwaggerWcf/SwaggerWcf.nuspec index 61d5c36..8608a74 100644 --- a/src/SwaggerWcf/SwaggerWcf.nuspec +++ b/src/SwaggerWcf/SwaggerWcf.nuspec @@ -10,7 +10,7 @@ https://github.com/abelsilva/swaggerwcf false $description$ - swagger-ui updated to 2.2.10 - fixes #55 + allow data classes to be used without DataContract/DataMember attributes - fixes #64 Copyright 2015 swagger wcf .net c#