diff --git a/src/SwaggerWcf/Support/TypeExtensions.cs b/src/SwaggerWcf/Support/TypeExtensions.cs index 96e3076..0ae7934 100644 --- a/src/SwaggerWcf/Support/TypeExtensions.cs +++ b/src/SwaggerWcf/Support/TypeExtensions.cs @@ -27,7 +27,10 @@ public static string GetModelWrappedName(this Type type) => internal static Info GetServiceInfo(this TypeInfo typeInfo) { - var infoAttr = typeInfo.GetCustomAttribute() ?? + var infoAttr = typeInfo.GetCustomAttribute(); + if (infoAttr == null && SwaggerWcfEndpoint.Info != null) + return SwaggerWcfEndpoint.Info; + else if (infoAttr == null && SwaggerWcfEndpoint.Info == null) throw new ArgumentException($"{typeInfo.FullName} does not have {nameof(SwaggerWcfServiceInfoAttribute)}"); var info = (Info)infoAttr;