Skip to content

Commit

Permalink
XmlComment example tags for string properties where the example is <e…
Browse files Browse the repository at this point in the history
…xample>null</example> will now resolve to a null value instead of the string "null"
  • Loading branch information
Dunnymeister committed Jun 29, 2021
1 parent b8dcad3 commit 30f9bf9
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -48,7 +48,7 @@ private void ApplyMemberTags(OpenApiSchema schema, SchemaFilterContext context)
var exampleNode = fieldOrPropertyNode.SelectSingleNode("example");
if (exampleNode != null)
{
var exampleAsJson = (schema.ResolveType(context.SchemaRepository) == "string")
var exampleAsJson = (schema.ResolveType(context.SchemaRepository) == "string") && !exampleNode.Value.Equals("null")
? $"\"{exampleNode.InnerXml}\""
: exampleNode.InnerXml;

Expand Down

0 comments on commit 30f9bf9

Please sign in to comment.