Skip to content

Commit

Permalink
Merge pull request #126 from scott-xu/patch-1
Browse files Browse the repository at this point in the history
Update SchemaExtensions.cs
  • Loading branch information
heldersepu authored Jun 12, 2023
2 parents 829b30b + da70e6f commit 0714cc7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Swagger.Net/Swagger/Extensions/SchemaExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ public static Schema WithDescriptionProperty(this Schema schema, JsonProperty js
return schema;

var attrib = propInfo.GetCustomAttributes(false).OfType<SwaggerDescriptionAttribute>().FirstOrDefault();
schema.description = attrib?.Description;
var description = attrib?.Description;
if (description != null)
schema.description = description;

return schema;
}

Expand Down

0 comments on commit 0714cc7

Please sign in to comment.